-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Grouping keys may be read by JDBC connector after aggregation pushdown even if not needed by upstream query execution #9021
Comments
Seems like it happens due to trino/plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/DefaultJdbcMetadata.java Lines 300 to 303 in 9e3a1db
We can try to be smarter about this and only add a projection for the grouping column if it's required (e.g. no aggregation function is present or the grouping column is part of an existing projection). I'll try and send a pull-request for this. |
please base it on #8562 work. |
I didn't find any meaningful "heuristic" on In the provided query ( |
Note:
? if it was wrapped, there wouldn't be a problem. |
@findepi good point I did not know workers further refine queries! When checking the postgres logs the actual query being ran is:
As you mentioned, it seems this issue is not actually an issue 🎉 |
Actually found the place where the query is refined before being executed here: |
Closing as "Cannot reproduce". |
Today I learnt as well. @findepi please correct if wrong. Also does this mean that |
@hashhar applyLimit does not fire on the workers, but if the planner rules that use applyLimit fire they will tack information onto the Initial query: right before buildSql, note right after: |
exactly.
this is on worker
|
The upstream issue: trinodb#9021 cannot be reproduced, see the issue for details
The upstream issue: trinodb#9021 cannot be reproduced, see the issue for details
The upstream issue: #9021 cannot be reproduced, see the issue for details
The upstream issue: trinodb#9021 cannot be reproduced, see the issue for details
Reproducable via PostgreSqlQueryRunner
See TODO in the code being added in #8562
The text was updated successfully, but these errors were encountered: