-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add projection pushdown support to MongoDB #16790
Conversation
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoTableHandle.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoMetadata.java
Show resolved
Hide resolved
d19cabc
to
b338dac
Compare
plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoConnectorTest.java
Show resolved
Hide resolved
for (MongoColumnHandle column : columns) { | ||
output.append(column.getName(), 1); | ||
|
||
if (tableHandle.getProjectedColumns().isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this condition instead of just relying on columns
passed by MongoPageSourceProvider
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder. It would be nice to leave a comment why the below code doesn't work if this condition is really needed.
for (MongoColumnHandle column : columns) {
output.append(column.getName(), 1);
}
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoTableHandle.java
Outdated
Show resolved
Hide resolved
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoMetadata.java
Outdated
Show resolved
Hide resolved
b338dac
to
7741186
Compare
7741186
to
eb85632
Compare
@ebyhr PTAL |
{ | ||
assertThat(query("SELECT orderdate, clerk FROM orders")).isFullyPushedDown(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add isFullyPushedDown
to testNativeQueryProjection
in this class?
for (MongoColumnHandle column : columns) { | ||
output.append(column.getName(), 1); | ||
|
||
if (tableHandle.getProjectedColumns().isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder. It would be nice to leave a comment why the below code doesn't work if this condition is really needed.
for (MongoColumnHandle column : columns) {
output.append(column.getName(), 1);
}
I'm dropping this effort as there is no consistent way of implementing projection pushdown across connectors. There is a different approach in BigQuery, Iceberg, Delta Lake and others. In BigQuery and Delta Lake we are passing projected columns as |
Addressed comments in #17618 |
Description
Additional context and related issues
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: