Array from nested data

I have a STREAM with this shema:

CREATE STREAM           st_e
( id       STRING key
, entity  STRUCT < id          STRING
                 , lineItems   ARRAY  < STRUCT < id  STRING 
                                               , productName    STRUCT < original    STRING >
                                      >
                 > 
) ...

I can get the productName from first item like
entity->lineItems[1]->productName->original
But how can I get the ARRAY of productName?

Hi!
take a look into TRANSFORM function (Since : 0.17.0 version)
in short words , it will perform lambda function for each element in array .
In your case it will be something like :
TRANSFORM( entity->lineItems, x=> x-> productName->original)

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.