Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4706

PrestoDBMetadataProcessor load metadata failed due to Duplicate Table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 9.2
    • 9.2
    • Misc. Connectors
    • None
    • Hide
      Show
      Install Presto( https://prestodb.io/docs/current/installation/deployment.html ) add a catalog, below is a example connector.name=mysql connection-url=jdbc:mysql: //10.66.192.120:3306/teiid connection-user=teiid_user connection-password=teiid_pass Run TEIID4682Presto as java application

      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

      SQL: SHOW CATALOGS
      +---------+
      | Catalog |
      +---------+
      | mysql   |
      | system  |
      +---------+
      

      Note that both mysql and system has schema: information_schema

      SQL: SHOW SCHEMAS FROM mysql
      +--------------------+
      |       Schema       |
      +--------------------+
      | information_schema |
      | teiid              |
      +--------------------+
      
      SQL: SHOW SCHEMAS FROM system
      +--------------------+
      |       Schema       |
      +--------------------+
      | information_schema |
      | jdbc               |
      | metadata           |
      | runtime            |
      +--------------------+
      

      Schema in different catalog contain the same tables

      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                   |
      +-------------------------+
      

      Due the table name in both system.information_schema and mysql.information_schema has same table name, the TEIID60013 Duplicate Table through

      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)
      

        1. teiid4682-vdb.xml
          0.3 kB
        2. TEIID4682Presto.java
          2 kB
        3. teiid4682-server-vdb.xml
          0.5 kB
        4. module.zip
          6.00 MB

              kylinsoong.1214@gmail.com Kylin Soong (Inactive)
              kylinsoong.1214@gmail.com Kylin Soong (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: