Re: How to flatten ARRAY in Table API

2022-02-20 Thread Matthias Broecheler
Thank you, David, that's what I had been looking for! On Sun, Feb 20, 2022 at 3:52 AM David Anderson wrote: > Matthias, > > You can use a CROSS JOIN UNNEST, as mentioned very briefly in the docs [1]. > > Something like this should work: > > SELECT > id, customerid, productid, quantity, ... > F

Re: How to flatten ARRAY in Table API

2022-02-20 Thread David Anderson
Matthias, You can use a CROSS JOIN UNNEST, as mentioned very briefly in the docs [1]. Something like this should work: SELECT id, customerid, productid, quantity, ... FROM orders CROSS JOIN UNNEST(entries) AS items (productid, quantity, unit_price, discount); [1] https://nightlies.apache.or

How to flatten ARRAY in Table API

2022-02-19 Thread Matthias Broecheler
Hey Flinksters, I'm reading a nested JSON object into a table and would like to access the nested rows inside an array. Is there a way to flatten them so that I get a table with the nested rows? So far, I've only been able to figure out how to access a specific element inside the array using the