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

Arvind Prabhakar commented on HIVE-1271:
----------------------------------------

Changes for HIVE-1271 (patch updated)
    
*Summary:*
The previously submitted patch removed the dependence of {{StructTypeInfo}} on 
field names for equivalence comparison. This patch reverts that change and 
addresses the type equivalence by canonical testing of field names.
    
*Details:*
The changes to {{TypeInfo}} hierarchy made by previous patch assumed that the 
field names should not be considered part of the {{StructTypeInfo}} for testing 
equivalence. This conflicts with the implementation of {{LazyBinarySerDe}} (and 
others perhaps) which rely on field name distinction for caching purposes. This 
update changes the implementation so that field names are used as before, but 
are compared using case-insensitive comparison when testing the equivalence of 
two {{StructTypeInfo}}s.    

*Testing Done:*
- Built and tested the usecase identified in this issue - it works now.
- Ran complete set of tests with the previously reported unrelated failures 
only.


> Case sensitiveness of type information specified when using custom reducer 
> causes type mismatch
> -----------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1271
>                 URL: https://issues.apache.org/jira/browse/HIVE-1271
>             Project: Hadoop Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.5.0
>            Reporter: Dilip Joseph
>            Assignee: Arvind Prabhakar
>         Attachments: HIVE-1271-1.patch, HIVE-1271.patch
>
>
> Type information specified  while using a custom reduce script is converted 
> to lower case, and causes type mismatch during query semantic analysis .  The 
> following REDUCE query where field name =  "userId" failed.
> hive> CREATE TABLE SS (
>    >                     a INT,
>    >                     b INT,
>    >                     vals ARRAY<STRUCT<userId:INT, y:STRING>>
>    >                 );
> OK
> hive> FROM (select * from srcTable DISTRIBUTE BY id SORT BY id) s
>    >     INSERT OVERWRITE TABLE SS
>    >     REDUCE *
>    >         USING 'myreduce.py'
>    >         AS
>    >                     (a INT,
>    >                     b INT,
>    >                     vals ARRAY<STRUCT<userId:INT, y:STRING>>
>    >                     )
>    >         ;
> FAILED: Error in semantic analysis: line 2:27 Cannot insert into
> target table because column number/types are different SS: Cannot
> convert column 2 from array<struct<userId:int,y:string>> to
> array<struct<userid:int,y:string>>.
> The same query worked fine after changing "userId" to "userid".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to