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 various issues with DatabaseMetadata and ResultsetMetadata interfaces #12

Open mainstreet439 opened 6 years ago

mainstreet439 commented 6 years ago

As originally noted at https://community.mapd.com/t/jdbc-driver-various-issues-with-databasemetadata-and-resultsetmetadata-interfaces/891

There are various methods in the MAPD driver which are throwing exceptions re items not being supported. In various cases, why not just implement a method which does nothing and document the fact vs throwing exceptions. This saves an application having to write wrapper code for the MAPD driver to bypass/deal with the issues.

setting/getting fetch size getting nativeSQL …

Any method which could return an empty ResultSet instead if called:

DatabaseMetadata.getUDTs DatabaseMetadata.getImportedKeys DatabaseMetadata.getTablePrivileges DatabaseMetadata.getColumnPrivileges DatabaseMetadata.getProcedures ...

If Catalogs are not supported, current code should not be trying to call getSchemas internally

If schemas are not supported, unclear why getSchemas is implemented

ResultsetMetadata.getColumnClassName fails

ResultsetMetadata.getPrecision fails

Suggest the various calls to logger be removed as it seems like someones test/debug code i.e

logger.info("Precision is " + ((TColumnType)this.sqlResult.row_set.row_desc.get(column - 1)).col_type.precision); logger.info("TablePattern " + tableNamePattern + " columnNamePattern " + columnNamePattern);