heavyai/heavyai-jdbc

JDBC driver DatabaseMetadata.getTables method returns views as type TABLE

mainstreet439 opened this issue · 1 comments

originally noted as https://community.mapd.com/t/jdbc-driver-databasemetadata-gettables-method-returns-views-as-type-table/924

When you call DatabaseMetadata.getTables it will return a TABLE_TYPE of TABLE for views created in MAPD.

null,null,TABLE1,TABLE,null,null,null,null,null,null
null,null,VIEW1,TABLE,null,null,null,null,null,null

Similarly, DatabaseMetadata.getTableTypes only returns TABLE as a type.

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-

https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getTableTypes--

Note heavyai/heavydb@f3de0a6, differentiating between tables & views without inefficient call to get table details, so possible fix path.