New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Trino DB #11485
Comments
Hint: Depending on the SQL queries one uses, people may have success using jOOQ's PostgreSQL dialects to connect to Trino. We have been using this workaround for more than 4 years now without any trouble. |
@bannmann |
@HasanAmmori I don't know what exactly is affected by the choice of dialects, so I can only guess: maybe the reason is that the product in question does not use jOOQ's query builder or code generation. It merely uses jOOQ to execute user-defined SQL queries and to read result sets. I imagine that is a rather unusual scenario, so if that is the only reason it works, then my hint above is useless to most people :-/ |
A dialect consists of:
By now, it takes me about 2 person weeks to fully support a new dialect initially, discounting all the efforts that appear after going live, maintaining the dialect for years. For example, I've already spent almost 2 days getting the Vertica dialect up to date with more recent jOOQ developments, given that a customer had a feature request, and the investment was justified: #11650 Other ORMs which do not offer nearly as much SQL functionality as jOOQ, may find tweaking their internals for new dialects simpler. Their generated SQL is trivial SQL-92 - sometimes not even supporting unions, which are hard enough to get right on their own with all the possible cases of required/optional/forbidden parentheses! So, the rule of thumb is this: You can get jOOQ to work with an existing dialect on a new database product to some extent. It will never be really as good as you're used to from supported dialects, and you will constantly run into issues, in case of which patching jOOQ or running plain SQL are the only options. We generally do not recommend using jOOQ with an unsupported dialect, but it may still work, and may still be better than any alternative. Having said so, I'm very open to a sponsored integration project. The financial effort of paying me for a Trino integration is likely less than the effort of patching jOOQ all the time when it doesn't work with Trino, and it will pay off in the long run, after years of Trino support. |
Looking into this for possible inclusion in jOOQ 3.19 First "fun" roadblock:
Not sure what I should think of this 😅 No support for |
Also:
Gee. Which connector should I use for integration testing, to avoid most quirks / get access to most features? Obviously, I don't want to test them all. |
Nevermind, found it: I can only chime in by saying that at our company we never used the memory connector once, we use the following connectors (of many supported by Trino): Just the fact that it is possible for (crazy) example to query Elasticsearch, Kafka, MongoDB, Redis and Oracle using standard SQL, even joining tables/documents from different DBs (that are not RDBMS with RDBMS) in the same query, makes Trino soooo powerful! Also many Fortune 100 companies now use Delta Lake in combination with Trino to store, fetch and analyze large-scale data. jOOQ supporting Trino starting with 3.19.0 would make a huge difference and would also be a major selling point compared to other ORMs. |
See https://trino.io/docs/current/connector/memory.html - when using the Memory connector the tables are effectively append-only. You can create a table, you can insert rows into it, and read them back; but you can't modify existing rows or delete them. |
Modifying existing rows, deletes, NOT NULL constraints are supported by Iceberg and Delta Lake connectors. |
Thanks for looking that up, @ThoSap, @richardfearn
No doubt, it is compelling for users. For me, I just need the path of least resistance to access the most features that are possibly available. I would have expected the memory (or file based) connector to be complete, because it does not "suffer" from any third party limitations, but obviously, that would mean that all transactional and other constraints would have to be implemented by trino itself. I guess trino is more about "distributing compute" rather than implementing stuff itself? Makes sense for end users, of course.
Yeah 😅 I guess once you use one of those more rare RDBMS from the bottom of the list here https://db-engines.com/en/ranking, then support for that RDBMS does become a "selling point." I don't think it will make a key difference for the jOOQ community, but anyway, the number of upvotes on the issue has helped the issue bubble up in this list: A contender is Clickhouse, but there, I think the vendor cheated with the upvotes. Anyway. I was planning on adding support for 2-3 new dialects in 3.19, and this has been requested a few times by existing paying customers as well, so that justifies the effort without trying to find separate budget.
I don't even know what those things are 😅 (Iceberg and Delta Lake). I don't really want to spend time setting them up in a test environment. How do you test these things? I mean, you have to have a complete test suite for all of the SQL features somewhere. Do you just test them indirectly via the connector that makes them available? Is there a support matrix somewhere that shows which SQL features are supported by which connector? (I'm aware that each connector lists things in prose, but a matrix would be cool) |
Anyway, the lack of |
- No NVARCHAR support - LIKE ANY and LIKE ALL support - Emulate FILTER for window functions
- Proper DECIMAL cast in RATIO_TO_REPORT - DOUBLE cast in linear regression functions
- Correct parser and interpreter name cases - Remove workarounds for trinodb/trino#16489 - Emulate LISTAGG .. FILTER - Emulate INSERT INTO <aliased table> - Support TIMESTAMPTZ literals and binds - Correctly recognise ARRAY types in MetaTable - Add M_SOURCES query to MetaSQL
The mask is supported, but it looks quite different from other dialects, when using format()
Integrated for jOOQ 3.19. The implementation is far from complete. The fact that the in-memory backend lacks a ton of functionality (yet it is the simplest to test without excessive test setup) means that jOOQ probably doesn't cover some stuff users might be using, e.g. This can be addressed in future releases, still. |
To anyone interested in this dialect, please note that early feedback is very appreciated! You can build the jOOQ Open Source Edition off github, or work with a 3.19.0-SNAPSHOT build, if you're licensed: |
Formerly known as Presto (#5414), now Trino:
https://trino.io/blog/2020/12/27/announcing-trino.html
Database features / missing features
NOT NULL
constraints (??): Enforcement of NOT NULL column constraints trinodb/trino#4070DEFAULT
Some bugs found:
position
function trinodb/trino#16516Missing features to work around:
Also, existing PrestoDB limitations:
See also:
The text was updated successfully, but these errors were encountered: