问题
I have following query running on Big query and it's working fine:
select
item_detail.location.zone,
count(*)
FROM table t
CROSS JOIN UNNEST(items) as item_detail
group by 1;
But when i running the same query in Presto it's giving me an error it's because my items structure is like this Arrays of Arrays so i modified my query like this:
SELECT location.zone
FROM table
CROSS JOIN UNNEST(items) as t(item, quantity,location);
But it's throwing me this error:
Presto error: Unhandled type for Block:
array(row("item" row("departmentNumber" bigint,"itemNumber" bigint,"shelfCapacity" row("qty" double,"precision" bigint)),
"quantity" row("qty" double,"precision" bigint),
"location" row("zone" varchar,"aisle" bigint)))
As you can see for item
is having an array shelfCapacity
inside it, how to unnest this type of array where you have array inside array
来源:https://stackoverflow.com/questions/62084520/presto-unnest-array-inside-array