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

Jimmy Xiang commented on HIVE-13237:
------------------------------------

Thanks a lot for the review. The issue is that when ExprNodeFieldEvaluator 
initializes:
{noformat}
field = structObjectInspector.getStructFieldRef(expr.getFieldName());
{noformat}
It tries to get the struct field based on the field name. Here, the field name 
is "fieldone". The object inspector is ArrayWritableObjectInspector, which 
saves the name to field mapping to a map. In the map, the name is "fieldOne",
so the line above gets a null field.  The patch is to make sure the lookup to 
be case insensitive.

> Select parquet struct field with upper case throws NPE
> ------------------------------------------------------
>
>                 Key: HIVE-13237
>                 URL: https://issues.apache.org/jira/browse/HIVE-13237
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Jimmy Xiang
>            Assignee: Jimmy Xiang
>         Attachments: HIVE-13237.1.patch
>
>
> Query "select msg.fieldone from test" throws NPE if msg's fieldone is 
> actually fieldOne:
> {noformat}
> 2016-03-08 17:30:57,772 ERROR [main]: exec.FetchTask 
> (FetchTask.java:initialize(86)) - java.lang.NullPointerException
>         at 
> org.apache.hadoop.hive.ql.exec.ExprNodeFieldEvaluator.initialize(ExprNodeFieldEvaluator.java:61)
>         at 
> org.apache.hadoop.hive.ql.exec.Operator.initEvaluators(Operator.java:954)
>         at 
> org.apache.hadoop.hive.ql.exec.Operator.initEvaluatorsAndReturnStruct(Operator.java:980)
>         at 
> org.apache.hadoop.hive.ql.exec.SelectOperator.initializeOp(SelectOperator.java:63)
>         at 
> org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:385)
> {noformat}



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

Reply via email to