heavyai / heavyai-jdbc

A JDBC driver for connecting to an HeavyAI GPU database and running queries.
https://www.heavy.ai/
Other
9 stars 16 forks source link

JDBC driver DatabaseMetadata.getTables method returns views as type TABLE #9

Open mainstreet439 opened 6 years ago

mainstreet439 commented 6 years ago

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--

billmaimone commented 6 years ago

Note https://github.com/mapd/mapd-core/commit/f3de0a6281795642e20efa60ca08d71dcf4c64d2, differentiating between tables & views without inefficient call to get table details, so possible fix path.