Array of rows overview
Because FeatureQL is entity based, the array of rows structure is very commonly used to represent collections of facts related to an entity.
FeatureQL has then strong support for arrays and arrays of rows.
| Operation | Syntax | Description | Scope |
|---|---|---|---|
| Access rows | <array_of_rows>[<index>] or <array_of_rows>[<start>:<end>] | Extract one or a range of rows as an array of rows | rows |
| Access fields | <array_of_rows>[<field1>, <field2>...] | Extract fields from an array of rows as a array of values (one field) or an array of rows (many fields) | fields |
| Unwrap | UNWRAP(<array_of_rows>) | Unwraps an array of one field rows as a array of values (convenient when the name of the field is not named) | fields |
| Concatenate | ARRAY_CONCAT(<array_of_rows1>, <array_of_rows2> (DEDUPLICATED ON <field1>, <field2>...)) | Concatenates the rows of the two arrays of rows, possibly deduplicated on one or many fields values | rows |
| Zip | ZIP(<array_of_rows1>, <array_of_rows2>) | Zips one or many arrays into an array of rows | fields |
| Merge (by positions) | ARRAY_MERGE(<array_of_rows1>, <array_of_rows2>) | Combines two or more arrays of rows | fields |
| Merge (by values) | ARRAY_MERGE(<array_of_rows1>, <array_of_rows2> (JOINED ON <field1>, <field2>...)) | Merge the rows of two arrays of rows by joining on a field | fields and rows |
| Extend | EXTEND(<array_of_rows> WITH <feature>) | Adds features as fields to an array of rows by joining on an existing field | fields |
| Transform | TRANSFORM(<array_of_rows> WITH <subquery>) | Applies transformations to an array of rows (map, filter, aggregate) | fields and rows |
You can see the full list of array of rows functions in the Functions page.
Create array of rows
Access fields and rows
Concatenate two arrays of rows
Zip and merge by position
@fql-playground(array_of_rows_zip_merge_by_positions)
Merge by value
Coming soon
This capability is not yet available.