how to cross join unnest a json array in presto
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Given a table that contains a column of JSON like this: {"payload":[{"type":"b","value":"9"}, {"type":"a","value":"8"}]} {"payload":[{"type":"c","value":"7"}, {"type":"b","value":"3"}]} How can I write a Presto query to give me the average b value across all entries? So far I think I need to use something like Hive's lateral view explode , whose equivalent is cross join unnest in Presto. But I'm stuck on how to write the Presto query for cross join unnest . How can I use cross join unnest to expand all array elements and select them? 回答1: As