Refactor QueryBuilder usage and implement *char join pushdown in PostgreSQL#10059
Conversation
1ddb6c5 to
f754a18
Compare
plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDefaultJdbcQueryBuilder.java
Outdated
Show resolved
Hide resolved
|
Seems straightforward, as @hashhar said having an example implementation might help in visualizing why the change is needed. |
f754a18 to
1203bd4
Compare
|
Supersedes #10435 |
|
I've implemented *char join pushdown for PostgreSQL |
1203bd4 to
1e76b97
Compare
...in/trino-postgresql/src/main/java/io/trino/plugin/postgresql/CollationAwareQueryBuilder.java
Outdated
Show resolved
Hide resolved
...in/trino-postgresql/src/main/java/io/trino/plugin/postgresql/CollationAwareQueryBuilder.java
Outdated
Show resolved
Hide resolved
1d30723 to
84f31ae
Compare
hashhar
left a comment
There was a problem hiding this comment.
Nice. This would also allow us to accomodate other collation-sensitive pushdowns like predicates as well in a single place.
...in/trino-postgresql/src/main/java/io/trino/plugin/postgresql/CollationAwareQueryBuilder.java
Outdated
Show resolved
Hide resolved
...in/trino-postgresql/src/main/java/io/trino/plugin/postgresql/CollationAwareQueryBuilder.java
Outdated
Show resolved
Hide resolved
...in/trino-postgresql/src/main/java/io/trino/plugin/postgresql/CollationAwareQueryBuilder.java
Outdated
Show resolved
Hide resolved
d28b177 to
31562f7
Compare
|
Maybe squash " Pass join relation aliases as a variable " and " Extract join condition formatting to separate method " since the " Pass join relation aliases as a variable " doesn't seem to do anything by itself. |
|
Squash " Move public methods to the top of the class " with " Open DefaultQueryBuilder methods for overloading "? |
|
Why is " Pass ConnectorSession to isSupportedJoinCondition " needed? It's unclear from the commit history where/if it's being used? |
hashhar
left a comment
There was a problem hiding this comment.
The history is too fine-grained IMO. Makes following it a bit difficult.
The changes overall make sense.
I had a question - would just opening up the formatJoinCondition be sufficient for our case? The ability to provide different QueryBuilder seems like a hammer that can be easily misused/make code difficult to follow.
|
There was a problem hiding this comment.
Maybe BaseJdbcClient should provide a method to fetch the collation name that matches Trino semantics?
It'll make this method more re-usable across databases since not every database has a C collation.
Also same for the collation syntax.
Or maybe this should be left for future when we notice we are adding CollationAwareQueryBuilder2?
Ah, so it's needed for "Move collation-aware pushdown to query builder". Maybe it should be squashed together. 🙂 |
|
@hashhar that's correct. That's why I've made it extensible |
|
@ebyhr Good point. @wendigo Can you add a commit before "Pass QueryBuilder instance through the JdbcClient constructor" which just creates an unused exact copy of |
31562f7 to
c5d3cf3
Compare
hashhar
left a comment
There was a problem hiding this comment.
Just some checkstyle fixes in "Pass QueryBuilder instance through the JdbcClient constructor"
It looks good to me otherwise.
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DefaultQueryBuilder.java
Outdated
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DefaultQueryBuilder.java
Outdated
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DefaultQueryBuilder.java
Outdated
Show resolved
Hide resolved
This is needed to be able to get WriteFunction for a column
c5d3cf3 to
8c00d95
Compare
|
cc: @grantatspothero Some Kudu flake? |

This is a preparatory step to be able to provide correct behavior when pushing down joins for case-(in)sensitive columns in the join condition comparisons