[
https://issues.apache.org/jira/browse/CALCITE-880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde resolved CALCITE-880.
---------------------------------
Resolution: Not A Problem
In http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/43b88dbf I
added "SYNONYM" as table type, so the message "Unknown table type: SYNONYM"
should no longer appear.
We can't force people to include "jdbcSchema" in their JDBC schema, and if they
don't, they will get duplicate tables. Since there's no way to fix this,
marking "not a problem".
> Cannot query Oracle databases
> -----------------------------
>
> Key: CALCITE-880
> URL: https://issues.apache.org/jira/browse/CALCITE-880
> Project: Calcite
> Issue Type: Bug
> Reporter: Marc Prud'hommeaux
> Assignee: Julian Hyde
>
> {noformat}
> 20:53 glimpse$ java -Djava.compiler=none -Djava.awt.headless=true
> sqlline.SqlLine -d 'org.apache.calcite.jdbc.Driver' -u
> 'jdbc:calcite:model=inline:{"version":1.0,"defaultSchema":"HR","schemas":[{"name":"oracle","type":"jdbc","jdbcUrl":"jdbc:oracle:thin:@XXX","jdbcDriver":"oracle.jdbc.OracleDriver","jdbcUser":"XXX","jdbcPassword":"XXX"}]}'
> Connected to: Calcite (version 1.5.0-incubating-SNAPSHOT)
> Driver: Calcite JDBC Driver (version 1.5.0-incubating-SNAPSHOT)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_UNCOMMITTED
> sqlline version 1.0.1 by Marc Prud'hommeaux
> 0: jdbc:calcite:model=inline:{"version":1.0,"> select * from
> "oracle"."COUNTRIES";
> Unknown table type: SYNONYM
> Unknown table type: SYNONYM
> ... repeated many times ...
> Error: error while executing SQL "select * from "oracle"."COUNTRIES"":
> duplicate key: WWV_FLOW_DUAL100 (state=,code=0)
> java.sql.SQLException: error while executing SQL "select * from
> "oracle"."COUNTRIES"": duplicate key: WWV_FLOW_DUAL100
> at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
> at
> org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:112)
> at
> org.apache.calcite.avatica.AvaticaStatement.execute(AvaticaStatement.java:121)
> at sqlline.SqlLine$Commands.execute(Unknown Source)
> at sqlline.SqlLine$Commands.sql(Unknown Source)
> at sqlline.SqlLine.dispatch(Unknown Source)
> at sqlline.SqlLine.begin(Unknown Source)
> at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)
> at sqlline.SqlLine.main(Unknown Source)
> Caused by: java.lang.IllegalArgumentException: duplicate key: WWV_FLOW_DUAL100
> at
> com.google.common.base.Preconditions.checkArgument(Preconditions.java:119)
> at
> com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:67)
> at
> com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:249)
> at
> com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:235)
> at
> org.apache.calcite.adapter.jdbc.JdbcSchema.computeTables(JdbcSchema.java:222)
> at
> org.apache.calcite.adapter.jdbc.JdbcSchema.getTableMap(JdbcSchema.java:238)
> at
> org.apache.calcite.adapter.jdbc.JdbcSchema.getTableNames(JdbcSchema.java:363)
> at org.apache.calcite.jdbc.CalciteSchema$3.build(CalciteSchema.java:116)
> at org.apache.calcite.jdbc.CalciteSchema$3.build(CalciteSchema.java:112)
> at
> org.apache.calcite.jdbc.CalciteSchema$AbstractCached.get(CalciteSchema.java:772)
> at
> org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:278)
> at
> org.apache.calcite.prepare.CalciteCatalogReader.getTableFrom(CalciteCatalogReader.java:116)
> at
> org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:105)
> at
> org.apache.calcite.prepare.CalciteCatalogReader.getTable(CalciteCatalogReader.java:70)
> at
> org.apache.calcite.sql.validate.EmptyScope.getTableNamespace(EmptyScope.java:75)
> at
> org.apache.calcite.sql.validate.DelegatingScope.getTableNamespace(DelegatingScope.java:124)
> at
> org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:104)
> at
> org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:844)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:830)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2744)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2729)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:2947)
> at
> org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
> at
> org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:86)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:844)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:830)
> at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:207)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:804)
> at
> org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:518)
> at
> org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:564)
> at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:223)
> at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:189)
> at
> org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:700)
> at
> org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:586)
> at
> org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:556)
> at
> org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:207)
> at
> org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:563)
> at
> org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:477)
> at
> org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:110)
> ... 7 more
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)