Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.10.0
-
None
-
None
Description
DatabaseMetadata.getTables supports being passed a NULL value for a catalog/schema and % for schema.
A very basic call to introspect a database without explicitly passing a schema name (i.e. %) doesn't work making the driver essentially useless.
It will only function is someone presumes that an application knows the schema name it is looking for or is iterating the Resultset from getSchemas and then nested looping on getTables.
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"};
ResultSet rs = dbMeta.getTables( null, null, "%", tableTypes);
ResultSet rs = dbMeta.getTables( "DRILL", null, "%", tableTypes);
ResultSet rs = dbMeta.getTables( "DRILL", "%", "%", tableTypes);