LATERAL VIEW EXPLODE in presto
From the documentation: https://trino.io/docs/current/appendix/from-hive.html
Trino [formerly PrestoSQL] supports UNNEST for expanding arrays and maps. Use
UNNEST
instead ofLATERAL VIEW explode()
.
Hive query:
SELECT student, score
FROM tests
LATERAL VIEW explode(scores) t AS score;
Presto query:
SELECT student, score
FROM tests
CROSS JOIN UNNEST(scores) AS t (score);