N Campbell created DRILL-5613:
---------------------------------

             Summary: DatabaseMetadata.getTables throws exception is the 
catalog parameter is set to NULL
                 Key: DRILL-5613
                 URL: https://issues.apache.org/jira/browse/DRILL-5613
             Project: Apache Drill
          Issue Type: Bug
          Components: Client - JDBC
    Affects Versions: 1.10.0
            Reporter: N Campbell


DatabaseMetadata.getTables supports being passed a NULL value for a catalog

https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getTables-java.lang.String-java.lang.String-java.lang.String-java.lang.String:A-

Doing so results in a JDBC exception from Drill

java.sql.SQLException: Failure getting metadata: 
        at 
org.apache.drill.jdbc.impl.DrillMetaImpl$MetadataAdapter.getMeta(DrillMetaImpl.java:310)
        at 
org.apache.drill.jdbc.impl.DrillMetaImpl.serverGetTables(DrillMetaImpl.java:394)
        at 
org.apache.drill.jdbc.impl.DrillMetaImpl.getTables(DrillMetaImpl.java:428)
        at 
oadd.org.apache.calcite.avatica.AvaticaDatabaseMetaData.getTables(AvaticaDatabaseMetaData.java:587)
        at 
org.apache.drill.jdbc.impl.DrillDatabaseMetaDataImpl.getTables(DrillDatabaseMetaDataImpl.java:1145)


String [] tableTypes = { "VIEW", "SYNONYM", "TABLE"};
try {           
                ResultSet rs = dbMeta.getTables( null, null, "%", tableTypes);
.....




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to