Skip to content
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

Predicates on JSON column fails in MongoDB connector #13536

Closed
ebyhr opened this issue Aug 8, 2022 · 3 comments · Fixed by #13762
Closed

Predicates on JSON column fails in MongoDB connector #13536

ebyhr opened this issue Aug 8, 2022 · 3 comments · Fixed by #13762
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ebyhr
Copy link
Member

ebyhr commented Aug 8, 2022

We can just disable the pushdown on json column in MongoDB connector. TestMongoTypeMapping needs a new test method for json type when fixing this issue.

CREATE TABLE test (c1 json);
INSERT INTO test VALUES (json '{"id":0,"name":"user_0"}');

SELECT * FROM test WHERE c1 = json '{"id":0,"name":"user_0"}';
java.lang.UnsupportedOperationException
	at io.trino.spi.predicate.ValueSet.getRanges(ValueSet.java:122)
	at io.trino.plugin.mongodb.MongoSession.buildPredicate(MongoSession.java:438)
	at io.trino.plugin.mongodb.MongoSession.buildQuery(MongoSession.java:417)
	at io.trino.plugin.mongodb.MongoSession.execute(MongoSession.java:398)
	at io.trino.plugin.mongodb.MongoPageSource.<init>(MongoPageSource.java:108)
	at io.trino.plugin.mongodb.MongoPageSourceProvider.createPageSource(MongoPageSourceProvider.java:59)
	at io.trino.split.PageSourceManager.createPageSource(PageSourceManager.java:62)
	at io.trino.operator.ScanFilterAndProjectOperator$SplitToPages.process(ScanFilterAndProjectOperator.java:268)
	at io.trino.operator.ScanFilterAndProjectOperator$SplitToPages.process(ScanFilterAndProjectOperator.java:196)
	at io.trino.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:338)
	at io.trino.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:391)
	at io.trino.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:325)
	at io.trino.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:391)
	at io.trino.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:325)
	at io.trino.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:391)
	at io.trino.operator.WorkProcessorUtils.getNextState(WorkProcessorUtils.java:240)
	at io.trino.operator.WorkProcessorUtils.lambda$processStateMonitor$3(WorkProcessorUtils.java:219)
	at io.trino.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:391)
	at io.trino.operator.WorkProcessorUtils.getNextState(WorkProcessorUtils.java:240)
	at io.trino.operator.WorkProcessorUtils.lambda$finishWhen$4(WorkProcessorUtils.java:234)
	at io.trino.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:391)
	at io.trino.operator.WorkProcessorSourceOperatorAdapter.getOutput(WorkProcessorSourceOperatorAdapter.java:150)
	at io.trino.operator.Driver.processInternal(Driver.java:410)
	at io.trino.operator.Driver.lambda$process$10(Driver.java:313)
	at io.trino.operator.Driver.tryWithLock(Driver.java:698)
	at io.trino.operator.Driver.process(Driver.java:305)
	at io.trino.operator.Driver.processForDuration(Driver.java:276)
	at io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:740)
	at io.trino.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:164)
	at io.trino.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:490)
	at io.trino.$gen.Trino_testversion____20220808_001654_36.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
@ebyhr ebyhr added bug Something isn't working good first issue Good for newcomers labels Aug 8, 2022
@silly-carbon
Copy link
Member

Can I work on this issue? I'm very glad to help 😁

@martint
Copy link
Member

martint commented Aug 19, 2022

Go for it!

@silly-carbon
Copy link
Member

Go for it!

Thanks, I'll start doing now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Development

Successfully merging a pull request may close this issue.

3 participants