arrayConcat
Description
Returns a new array by concatenating the elements of two arrays into a single array.
- Both arrays must be of the same element type.
- Supported element types include
string
,bool
,number
,interval
,timestamp
,regexp
, andenum
.
Syntax
Like many functions in DataPrime, arrayConcat
supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.
Arguments
Name | Type | Required | Description |
---|---|---|---|
array1 | array | true | The first array to combine |
array2 | array | true | The second array to combine |
Example
Use case: Combine job queues into a single view
Suppose you want to view both processing and loading jobs in a single list. Consider the following input:
{
"processing_jobs_waiting": ["job1", "job2", "job3"],
"loading_jobs_waiting": ["loading_job1", "loading_job2", "loading_job3"]
}
By concatenating the arrays, you can see all jobs together in one array for simplified analysis.
Output
The result will combine both arrays:
{
"processing_jobs_waiting": ["job1", "job2", "job3"],
"loading_jobs_waiting": ["loading_job1", "loading_job2", "loading_job3"],
"all_jobs": ["job1", "job2", "job3", "loading_job1", "loading_job2", "loading_job3"]
}
Theme
Light