[
https://issues.jboss.org/browse/TEIID-4706?page=com.atlassian.jira.plugin...
]
Kylin Soong commented on TEIID-4706:
------------------------------------
I have test 0.162 with upstream code, this issue still exist, Duplicate Table issue cause
vdb deploy failed.
{code}
/subsystem=datasources/jdbc-driver=presto:add(driver-name=presto,
driver-module-name=com.facebook, driver-class-name=com.facebook.presto.jdbc.PrestoDriver)
/subsystem=datasources/data-source=prestoDS:add(connection-url="jdbc:presto://dvqe07.mw.lab.eng.bos.redhat.com:8888/mysql/bqt2",
jndi-name="java:/prestoDS", enabled=true, use-java-context=true,
driver-name=presto, user-name=root, password="root")
/subsystem=datasources/data-source=prestoDS:test-connection-in-pool()
{code}
Refer to attachment for driver module and vdb.
PrestoDBMetadataProcessor load metadata failed due to Duplicate
Table
---------------------------------------------------------------------
Key: TEIID-4706
URL:
https://issues.jboss.org/browse/TEIID-4706
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 9.2
Environment: Scenario one
* Presto 0.163 with one mysql catalog added
* Teiid 9.2.0.Beta2-SNAPSHOT in embedded mode
Scenario two
* Presto 0.162 with one mysql catalog added(QE test environment)
* Teiid 9.2.0.Beta2-SNAPSHOT server
Reporter: Kylin Soong
Assignee: Kylin Soong
Attachments: TEIID4682Presto.java, teiid4682-server-vdb.xml, teiid4682-vdb.xml
PrestoDBMetadataProcessor use 'SHOW CATALOGS', 'SHOW TABLES FROM ...' to
load tables from presto, presto default has a system catalog, in my test I only add one
mysql catalog
{code}
SQL: SHOW CATALOGS
+---------+
| Catalog |
+---------+
| mysql |
| system |
+---------+
{code}
Note that both mysql and system has schema: *information_schema*:
{code}
SQL: SHOW SCHEMAS FROM mysql
+--------------------+
| Schema |
+--------------------+
| information_schema |
| teiid |
+--------------------+
SQL: SHOW SCHEMAS FROM system
+--------------------+
| Schema |
+--------------------+
| information_schema |
| jdbc |
| metadata |
| runtime |
+--------------------+
{code}
Schema in different catalog contain the same tables
{code}
SQL: SHOW TABLES FROM mysql.information_schema
+-------------------------+
| Table |
+-------------------------+
| __internal_partitions__ |
| columns |
| schemata |
| tables |
| views |
+-------------------------+
SQL: SHOW TABLES FROM system.information_schema
+-------------------------+
| Table |
+-------------------------+
| __internal_partitions__ |
| columns |
| schemata |
| tables |
| views |
+-------------------------+
{code}
Due the table name in both system.information_schema and mysql.information_schema has
same table name, the *TEIID60013 Duplicate Table* through
{code}
Exception in thread "main" org.teiid.metadata.DuplicateRecordException:
TEIID60013 Duplicate Table __internal_partitions__
at org.teiid.metadata.Schema.addTable(Schema.java:49)
at org.teiid.metadata.MetadataFactory.addTable(MetadataFactory.java:231)
at
org.teiid.translator.jdbc.JDBCMetdataProcessor.addTable(JDBCMetdataProcessor.java:368)
at
org.teiid.translator.prestodb.PrestoDBMetadataProcessor.addTable(PrestoDBMetadataProcessor.java:147)
at
org.teiid.translator.prestodb.PrestoDBMetadataProcessor.getConnectorMetadata(PrestoDBMetadataProcessor.java:74)
at
org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:306)
at
org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:69)
at
org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96)
at
org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62)
at
org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
at org.teiid.runtime.EmbeddedServer.loadMetadata(EmbeddedServer.java:816)
at org.teiid.runtime.AbstractVDBDeployer.loadMetadata(AbstractVDBDeployer.java:210)
at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:766)
at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:707)
at org.teiid.test.teiid4699.TEIID4682Presto.main(TEIID4682Presto.java:41)
{code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)