Review Board 1.7.22


HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code

Review Request #13315 - Created Aug. 6, 2013 and updated

Prasad Mujumdar
trunk
HIVE-5006
Reviewers
hive
hive-git
The JDBC PreparedStatement interface extends Statement interface. The Hive JDBC driver implementations of HivePreparedStatement interface is disjoint from the HiveStatement implementation. As a result there's some duplicate code in these two classes for executing query. Also patches like implicit close on re-execute etc. are not there for PreparedStatement.
Hive doesn't support parameters binding. The prepared statement implementation is basically to replace '?' in the statements with the bound parameters values. This implementation useful for migrating existing applications/tools to Hive that use prepared statement.

The patch refactors HivePreparedStatement to extend the HiveStatement. The PreparedStatement specific methods like execute(), executeQuery() etc. are simply replacing the parameters and then call corresponding methods in the underlying HiveStatement.
Added PreparedStatement test scenarios to TestJdbcDriver2. The existing tests for PreparedStatement also pass with the patch.
Total:
3
Open:
0
Resolved:
3
Dropped:
0
Status:
From:
Review request changed
Updated (Aug. 9, 2013, 7:35 a.m.)
Updated patch per review comment