hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chaoyu Tang" <ctang...@gmail.com>
Subject Re: Review Request 28403: HIVE-8889:JDBC Driver ResultSet.getXXXXXX(String columnLabel) methods Broken
Date Mon, 24 Nov 2014 22:44:44 GMT

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

(Updated Nov. 24, 2014, 10:44 p.m.)


Review request for hive, Ashutosh Chauhan, Prasad Mujumdar, and Szehon Ho.


Changes
-------

Revised based on Brock's review comments


Repository: hive-git


Description
-------

For JDBC application using query like select * , the columnLabel in ResultSet.getXXX(String
columnLabel) has to be a full-qualified name (e.g. tableName.colName) unless you set the hive.resultset.use.unique.column.names
to false, but this setting will break other cases which require the qualified name (see HIVE-6687).

I think Hive JDBC should not flip the support only to shortname or qualified name in getXXX(columnName)
depending on a property, instead it should support both at same time like that in MySQL. For
example, for queries to a table or view like following:
a)select * from src
b)select key from src
c)select * from srcview
d)select key from srcview
getXXX(key) and getXXX(src.key) (or getXXX(srcview.key)) should all work.

The changes in this patch include:
1. findColumn in HiveBaseResultSet will find a column either by short name or qualified name
2. HS2 always returns the qualified column name if possible, so remove the property hive.resultset.use.unique.column.names
3. Unit tests


Diffs (updated)
-----

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java fafd78e63e9b41c9fdb0e017b567dc719d151784

  itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java f2560e2e4793cca11950519708b1a666eb700e50

  jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java 8cbf9e7092489a2adb0bc2ba6b5ee38e41c041f8

  ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 1953e81e52bd7ada7b7ec750205a8e33edfcd9ae


Diff: https://reviews.apache.org/r/28403/diff/


Testing
-------

1. New test cases in TestJdbcDriver2.java passed
2. pre-committed tests were submitted


Thanks,

Chaoyu Tang


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