-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Don't project _id field in Mongo DB connector when it's not required #18081
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
Conversation
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoSession.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoSession.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoSession.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoSession.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/test/java/io/trino/plugin/mongodb/TestMongoSession.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java
Show resolved
Hide resolved
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java
Outdated
Show resolved
Hide resolved
plugin/trino-mongodb/src/main/java/io/trino/plugin/mongodb/MongoSession.java
Outdated
Show resolved
Hide resolved
@ebyhr addressed comments. please take a look. |
the tests which are failing are hive/hadoop related. 99% sure not related to this. |
Can we use Builder from MongoDB driver - https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/#using-builders which has some predefined APIs we could use. |
Would it be better to do it in a different PR? as otherwise this PR would be changing two things 1. excludeId 2. changing implementation of how projections are built(implementation+return type(bson(new) vs document(current)). and neither are currently directly tested. @Praveen2112 |
@ebyhr @Praveen2112 can you please take a look? thanks |
Could you rebase on master to resolve conflicts? |
Description
Currently, _id field is retrieved even when it's not necessary. We can exclude by https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/builders/projections/#exclusion-of-_id.
Fixes #17970
Release notes
(x) This is not user-visible or docs only and no release notes are required.