[ 
https://issues.apache.org/jira/browse/HIVE-8889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chaoyu Tang updated HIVE-8889:
------------------------------
    Attachment: HIVE-8889.patch

Basically it was introduced in HIVE-6687 in Hive 0.13. Currently you might have 
to work around your select * case by setting set 
hive.resultset.use.unique.column.names to false. But it will break other case. 
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.
Uploaded patch to https://reviews.apache.org/r/28403/ and requesting for review.

> JDBC Driver ResultSet.getXXXXXX(String columnLabel) methods Broken
> ------------------------------------------------------------------
>
>                 Key: HIVE-8889
>                 URL: https://issues.apache.org/jira/browse/HIVE-8889
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.13.1
>            Reporter: G Lingle
>            Assignee: Chaoyu Tang
>            Priority: Critical
>         Attachments: HIVE-8889.patch
>
>
> Using hive-jdbc-0.13.1-cdh5.2.0.jar.
> All of the get-by-column-label methods of HiveBaseResultSet are now broken.  
> They don't take just the column label as they should.  Instead you have to 
> pass in <table name>.<column name>.  This requirement doesn't conform to the 
> java ResultSet API which specifies:
> "columnLabel - the label for the column specified with the SQL AS clause. If 
> the SQL AS clause was not specified, then the label is the name of the column"
> Looking at the code, it seems that the problem is that findColumn() method is 
> looking in normalizedColumnNames instead of the columnNames.
> BTW, Another annoying issue with the code is that the SQLException thrown 
> gives no indication of what the problem is.  It should at least say that the 
> column name wasn't found in the description string.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to