Igor Guzenko created DRILL-7415: ----------------------------------- Summary: Information schema query fails for postgres foreign tables Key: DRILL-7415 URL: https://issues.apache.org/jira/browse/DRILL-7415 Project: Apache Drill Issue Type: Bug Affects Versions: 1.16.0 Reporter: Igor Guzenko Assignee: Igor Guzenko Fix For: Future
1) Setup a JDBC driver in Drill to Postgres 2) Create a public foreign tables like below in postgres public | vessel | foreign table | postgres public | vessel_movement | foreign table | postgres public | vessel_movement_hist | foreign table | postgres 3) Execute query in Drill {code:sql}SELECT * FROM `INFORMATION_SCHEMA`.`TABLES`;{code} *Actual result* {code} Caused by: java.lang.IllegalArgumentException: Multiple entries with same key: vessel=JdbcTable {vessel} and vessel=JdbcTable {vessel} at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:136) ~[guava-19.0.jar:na] at com.google.common.collect.RegularImmutableMap.checkNoConflictInKeyBucket(RegularImmutableMap.java:98) ~[guava-19.0.jar:na] at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:84) ~[guava-19.0.jar:na] at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:295) ~[guava-19.0.jar:na] at org.apache.calcite.adapter.jdbc.JdbcSchema.computeTables(JdbcSchema.java:269) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0] at org.apache.calcite.adapter.jdbc.JdbcSchema.getTableMap(JdbcSchema.java:285) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0] at org.apache.calcite.adapter.jdbc.JdbcSchema.getTableNames(JdbcSchema.java:410) ~[calcite-core-1.18.0-drill-r0.jar:1.18.0-drill-r0] at org.apache.drill.exec.store.jdbc.JdbcStoragePlugin$CapitalizingJdbcSchema.getTableNames(JdbcStoragePlugin.java:282) ~[drill-jdbc-storage-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.AbstractSchema.getTableNamesAndTypes(AbstractSchema.java:299) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator$Tables.visitTables(InfoSchemaRecordGenerator.java:340) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.scanSchema(InfoSchemaRecordGenerator.java:254) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.scanSchema(InfoSchemaRecordGenerator.java:247) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.scanSchema(InfoSchemaRecordGenerator.java:247) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaRecordGenerator.scanSchema(InfoSchemaRecordGenerator.java:234) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaTableType.getRecordReader(InfoSchemaTableType.java:58) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaBatchCreator.getBatch(InfoSchemaBatchCreator.java:34) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.store.ischema.InfoSchemaBatchCreator.getBatch(InfoSchemaBatchCreator.java:30) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.physical.impl.ImplCreator.getRecordBatch(ImplCreator.java:159) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.physical.impl.ImplCreator.getChildren(ImplCreator.java:182) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.physical.impl.ImplCreator.getRecordBatch(ImplCreator.java:137) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.physical.impl.ImplCreator.getChildren(ImplCreator.java:182) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.physical.impl.ImplCreator.getRootExec(ImplCreator.java:110) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.physical.impl.ImplCreator.getExec(ImplCreator.java:87) ~[drill-java-exec-1.16.0.jar:1.16.0] at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:263) [drill-java-exec-1.16.0.jar:1.16.0] {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)