GetArrayElements (Azure Stream Analytics)

Returns a dataset with array values and indexes. The result of the GetArrayElements function must be used with CROSS APPLY operator only. This function is useful for parsing arrays and nested objects in JSON and AVRO formatted input event data. For more examples, see Parsing JSON and AVRO data.

Syntax

GetArrayElements ( column_reference )  

Arguments

column_reference

Is the column reference expression to be evaluated. Column must be of type Array.

Return Types

Returns a dataset with ArrayIndex and ArrayValue columns.

Examples

SELECT   
    arrayElement.ArrayIndex,  
    arrayElement.ArrayValue  
FROM input as event  
CROSS APPLY GetArrayElements(event.arrayField) AS arrayElement  
  

See also