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

Sushanth Sowmyan commented on HIVE-3221:
----------------------------------------

I don't have a specific query that can trigger off the top of my head - looking 
at ql.parse.SemanticAnalyzer indicates that this problem could occur when 
formulating a union plan. 

Essentially, reading "_col12" maps to "2" because it only reads the last 
character.

The sequence of events that led to my encountering this issue is in 
HCATALOG-436 when testing with the JsonSerDe (any named-column based format, 
really) and having more than 10 columns. I wanted to read an internal column 
name(as generated by a CTAS operation) and be able to figure out position and 
noticed that there are a pair of functions in HiveConf for exactly this purpose 
: getPositionFromInternalName and getColumnInternalName.

--

As to the case of having a column alias being "_c" and not "_col", 
HiveConf.java seems to indicate a hardcoded "_col" in getColumnInternalName, so 
I retained that. Do you have any cases where it's "_c" ?

Thanks!
                
> HiveConf.getPositionFromInternalName does not support more than sinle digit 
> column numbers
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-3221
>                 URL: https://issues.apache.org/jira/browse/HIVE-3221
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Sushanth Sowmyan
>            Assignee: Sushanth Sowmyan
>         Attachments: HIVE-3221.patch
>
>
> For positions above 9, HiveConf.getPositionFromInternalName only looks at the 
> last digit, and thus, causes collisions.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to