Skip to content

Fix duplicate key due to non-lowercase collections in MongoDB#24998

Merged
ebyhr merged 1 commit intotrinodb:masterfrom
ebyhr:ebi/mongodb-case-insensitivy
Feb 13, 2025
Merged

Fix duplicate key due to non-lowercase collections in MongoDB#24998
ebyhr merged 1 commit intotrinodb:masterfrom
ebyhr:ebi/mongodb-case-insensitivy

Conversation

@ebyhr
Copy link
Copy Markdown
Member

@ebyhr ebyhr commented Feb 12, 2025

Description

The connector threw "Duplicate key {schema}.{table} (attempted merging values TABLE and TABLE)" error when tables exist with different cases like test and TEST.

io.trino.testing.QueryFailedException: Error listing tables for catalog mongodb: Duplicate key test_db_fymzuxlc22.test_collection_a2p6hs64ml (attempted merging values TABLE and TABLE)

	at io.trino.testing.AbstractTestingTrinoClient.execute(AbstractTestingTrinoClient.java:138)
	at io.trino.testing.DistributedQueryRunner.executeInternal(DistributedQueryRunner.java:565)
	at io.trino.testing.DistributedQueryRunner.execute(DistributedQueryRunner.java:548)
	at io.trino.sql.query.QueryAssertions$QueryAssert.lambda$new$1(QueryAssertions.java:317)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:200)
	at io.trino.sql.query.QueryAssertions$QueryAssert.result(QueryAssertions.java:436)
	at io.trino.sql.query.QueryAssertions$QueryAssert.matches(QueryAssertions.java:357)
	at io.trino.plugin.mongodb.TestMongoConnectorTest.testNonLowercaseCollection(TestMongoConnectorTest.java:170)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1458)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2034)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:189)
	Suppressed: java.lang.Exception: SQL: SELECT * FROM information_schema.tables WHERE table_catalog = 'mongodb' AND table_schema = 'test_db_fymzuxlc22'
		at io.trino.testing.DistributedQueryRunner.executeInternal(DistributedQueryRunner.java:572)
		... 12 more

Release notes

## MongoDB
* Fix failure when tables exist with different cases. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Feb 12, 2025
@github-actions github-actions bot added the mongodb MongoDB connector label Feb 12, 2025
@ebyhr ebyhr force-pushed the ebi/mongodb-case-insensitivy branch from 6474e39 to b92e9b5 Compare February 13, 2025 08:46
@ebyhr ebyhr merged commit 247b65d into trinodb:master Feb 13, 2025
@ebyhr ebyhr deleted the ebi/mongodb-case-insensitivy branch February 13, 2025 10:12
@github-actions github-actions bot added this to the 471 milestone Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed mongodb MongoDB connector

Development

Successfully merging this pull request may close these issues.

2 participants