basho-labs / Riak-TS-JDBC-Driver

JDBC client for Basho's Riak TS database (http://docs.basho.com/riak/ts/), see https://github.com/cvitter/Riak-TS-JDBC-Driver/tree/master/riakts.jdbc.driver for documentation.
Apache License 2.0
10 stars 2 forks source link

Refactor Utility.getResultSetFromQueryResult #19

Closed cvitter closed 8 years ago

cvitter commented 8 years ago

Note following todo:

// TODO: Find efficient method to not repeatedly set column type as we write the data

Currently we determine the data type of each column and update the corresponding value in the ResultSetMetaData object (the following is an example of this is done for booleans):

rs.getMetaData().updateColumnType(colIndex, java.sql.Types.BOOLEAN, "java.sql.Types.BOOLEAN");

every time we read/write a column value. It would be more efficient if we set the column data type for each column only while reading the first row. The potential issue with this is that if a column value is null we won't be able to determine its datatype.

Refactor the code to make it as efficient as possible.

cvitter commented 8 years ago

Refactored, see commit https://github.com/cvitter/Riak-TS-JDBC-Driver/commit/24f2430b094a7b02fbfe445be8d746c2ecfc1f19