[ 
https://issues.apache.org/jira/browse/HIVE-24147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17194002#comment-17194002
 ] 

Jesus Camacho Rodriguez commented on HIVE-24147:
------------------------------------------------

The patch I put together in https://github.com/apache/hive/pull/1486 is 
basically a bandage.
Instead, we should probably return proper column names in the JDBC result set 
metadata call. It seems the appending is controlled by 
{{hive.resultset.use.unique.column.names}}, which is set to {{true}} by 
default. I am not sure about the implications of setting it to {{false}}, but 
an option to uniquify those column names would be to use numeral after the 
column name instead of prepending the {{table alias + '.'}}. In addition, we 
could rely on the {{ResultSetMetaData.getTableName}} method to return the table 
name if desired. However, if any application is relying somehow on the column 
names having a certain format, this may result in a change of behavior for 
those.
Thus, maybe the bandage works for the time being.

> Table column names are not extracted correctly in Hive JDBC storage handler
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-24147
>                 URL: https://issues.apache.org/jira/browse/HIVE-24147
>             Project: Hive
>          Issue Type: Bug
>          Components: JDBC storage handler
>    Affects Versions: 4.0.0
>            Reporter: Jesus Camacho Rodriguez
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It seems the `ResultSetMetaData` extracted from the query to retrieve the 
> table columns names contains these columns as fully qualified names instead 
> of possibly using the {{getTableName}} method. This ends up throwing the 
> storage handler off and leading to exceptions, both in CBO path and non-CBO 
> path.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to