Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # dev >> Review Request 13315: HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code


+
Prasad Mujumdar 2013-08-06, 08:08
+
Thejas Nair 2013-08-06, 21:36
+
Prasad Mujumdar 2013-08-09, 07:34
Copy link to this message
-
Re: Review Request 13315: HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/13315/
-----------------------------------------------------------

(Updated Aug. 9, 2013, 7:35 a.m.)
Review request for hive.
Changes
-------

Updated patch per review comment
Bugs: HIVE-5006
    https://issues.apache.org/jira/browse/HIVE-5006
Repository: hive-git
Description
-------

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.
Diffs (updated)
-----

  jdbc/src/java/org/apache/hive/jdbc/HivePreparedStatement.java dfcd536
  jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java f35a351

Diff: https://reviews.apache.org/r/13315/diff/
Testing
-------

Added PreparedStatement test scenarios to TestJdbcDriver2. The existing tests for PreparedStatement also pass with the patch.
Thanks,

Prasad Mujumdar