Nested Data Functions

FLATTEN

Creates a new entry in the dataset for each element in a given JSON array.

Syntax FLATTEN([jsonarray] j)

Example

For a given dataset with a single record:

{
  "product" : "Product1",
  "categories" : ["A","B","C"]
}

Flatten function will create three records for each product category:

SELECT FLATTEN(categories) FROM dataset
product cateogories
Product1 A
Product1 B
Product1 C

results matching ""

    No results matching ""