Push down COALESCE in PostgreSQL connector#11535
Push down COALESCE in PostgreSQL connector#11535ebyhr wants to merge 6 commits intotrinodb:masterfrom
Conversation
|
@ebyhr can you please rebase? |
4dff92a to
5bb372b
Compare
|
@findepi Rebased on upstream. |
findepi
left a comment
There was a problem hiding this comment.
"Translate COALESCE to connector expressions"
core/trino-main/src/main/java/io/trino/sql/planner/ConnectorExpressionTranslator.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/ConnectorExpressionTranslator.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Yes,I will note it down to unify that after those PRs are merged.
...lugin-toolkit/src/main/java/io/trino/plugin/base/expression/ConnectorExpressionPatterns.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/planner/ConnectorExpressionTranslator.java
Outdated
Show resolved
Hide resolved
5bb372b to
22099ed
Compare
...n/trino-postgresql/src/test/java/io/trino/plugin/postgresql/TestPostgreSqlConnectorTest.java
Outdated
Show resolved
Hide resolved
22099ed to
c77604c
Compare
There was a problem hiding this comment.
TryExpression is desugared to try function and it's marked as non-deterministic.
We don't push non-deterministic predicates down into the connector, however, they are handled separately from non-translatable ones.
Thus, it's a wrong change, as it changes the semantics of the test case.
There was a problem hiding this comment.
Changed to SearchedCaseExpression though I have a local patch to support it as connector expressions. Do you have other suggested expressions?
There was a problem hiding this comment.
See #11511 (comment) and #11544 (comment)
I don't have a plan for testing things. @martint do you have one?
cc @wendigo @hashhar
c77604c to
6810da6
Compare
6810da6 to
1cd9346
Compare
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/expression/RewriteCoalesce.java
Outdated
Show resolved
Hide resolved
1cd9346 to
d4722a4
Compare
Yes, coalesce is described by the SQL spec as syntactic sugar for a CASE expression. |
|
If i remember correctly, the E.g. this should not fail similar to #11699 (comment), this means this should not be modeled as a function call. OTOH, modeling @martint what about we model |
d4722a4 to
0d80cff
Compare
|
(Rebased on upstream to resolve conflicts) |
@martint and I talked about this and because However, lambdas support is not a trivial thing, and we don't think we're currently ready to work on this yet. |
|
Thanks for your explanation. Let me close this PR. |
Description
Push down
COALESCEin PostgreSQL connectorDocumentation
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
(x) Release notes entries required with the following suggested text: