Nested Data Functions


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

Syntax FLATTEN([jsonarray] j)


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