hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasad Mujumdar" <>
Subject Review Request 13315: HIVE-5006: Re-factor HiveServer2 JDBC PreparedStatement to avoid duplicate code
Date Tue, 06 Aug 2013 08:08:07 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for hive.

Bugs: HIVE-5006

Repository: 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.


  jdbc/src/java/org/apache/hive/jdbc/ dfcd536 
  jdbc/src/test/org/apache/hive/jdbc/ 1042125 



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


Prasad Mujumdar

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message