I recently had to write SQL query generation for AWS Athena, which is based off Presto 0.217 It turns out that the dialect doesn't support LATERAL joins with a LIMIT in them. The below query only works if you remove the LIMIT clause. https://i.stack.imgur.com/rdB1s.png This makes saying things like "Fetch all artists where ..., for each artist fetch their first 3 albums where ..., and for each album fetch the top 10…
The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
11–20 of 70 posts
Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#12Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#13I recently had to write SQL query generation for AWS Athena, which is based off Presto 0.217 It turns out that the dialect doesn't support LATERAL joins with a LIMIT in them. The below query only works if you remove the LIMIT clause. https://i.stack.imgur.com/rdB1s.png This makes saying things like "Fetch all artists where ..., for each artist fetch their first 3 albums where ..., and for each album fetch the top 10…
Is it possible to achieve this with a window function?
https://stackoverflow.com/a/73129836/13485494
But man is it a huge PITA (especially when doing programmatic code generation of the SQL) compared to LATERAL joins
Someone familiar with the CockroachDB query planner showed me that a window function like this is what Cockroach turns LATERAL joins into for instance:
demo@127.0.0.1:26257/movr> explain select * from abc, lateral (select * from xyz where x = a limit 2);
• filter
│ estimated row count: 1
│ filter: row_num Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#14I recently had to write SQL query generation for AWS Athena, which is based off Presto 0.217 It turns out that the dialect doesn't support LATERAL joins with a LIMIT in them. The below query only works if you remove the LIMIT clause. https://i.stack.imgur.com/rdB1s.png This makes saying things like "Fetch all artists where ..., for each artist fetch their first 3 albums where ..., and for each album fetch the top 10…
Check out this PR. I believe we may have tackled this one but you'd need to try it out on Trino: https://github.com/trinodb/trino/pull/1415
Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#15It would be super good if you guys added big query write support. Its really annoying to have to run a hive cluster in google to act as a proxy for this.
Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#16I do the support for my department's trino cluster. We move ~1tb (and growing) in ETL jobs and support interactive queries for the data scientists/analysts. It would be super good if you guys added big query write support. Its really annoying to have to run a hive cluster in google to act as a proxy for this.
Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#17I recently had to write SQL query generation for AWS Athena, which is based off Presto 0.217 It turns out that the dialect doesn't support LATERAL joins with a LIMIT in them. The below query only works if you remove the LIMIT clause. https://i.stack.imgur.com/rdB1s.png This makes saying things like "Fetch all artists where ..., for each artist fetch their first 3 albums where ..., and for each album fetch the top 10…
If that's not peak Amazon, I don't know what is.
Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#18Can Trino be used as a Snowflake replacement? How is the query speed compared to Snowflake?
My suggestion is to try both under your own workloads and see the difference. Trino is also used by products like Athena (AWS) and Galaxy (Starburst) so if you want to play around and see how Trino performs without spending too much time on setting up clusters on your own, you can try these great products.
Having said that, I'd like to add that building a performant distributed query engine is just hard. Trino has been in development for ten years and used by major companies in very demanding environments, these environments is where the technology has been defined and makes it what it is today and it is a proof of its performance and stability.
(edited to add an important disclaimer that I work at Starburst)
Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#19- https://github.com/bitsondatadev
- https://www.linkedin.com/in/bitsondatadev/
I recommend the Trino Slack for people not already in it: https://trino.io/slack.html
Re: The SQL query engine Trino (formerly PrestoSQL) recaps a decade of innovation
#20Can Trino be used as a Snowflake replacement? How is the query speed compared to Snowflake?