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

ASF GitHub Bot commented on DRILL-7254:
---------------------------------------

KazydubB commented on pull request #1869: DRILL-7254: Read Hive union w/o nulls
URL: https://github.com/apache/drill/pull/1869#discussion_r332935357
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillFuncHolder.java
 ##########
 @@ -241,7 +241,11 @@ protected void addProtectedBlock(ClassGenerator<?> g, 
JBlock sub, String body, H
             sub.assign(holderVar.ref("reader"), inputVariable.getHolder());
           }
         } else {
-          declare(sub, parameter, inputVariable.getHolder().type(), 
inputVariable.getHolder(), i);
+          JExpression exprToAssign = inputVariable.getHolder();
+          if (parameter.isVarArg() && parameter.isFieldReader() && 
Types.isUnion(inputVariable.getMajorType())) {
+            exprToAssign = exprToAssign.ref("reader");
+          }
+          declare(sub, parameter, inputVariable.getHolder().type(), 
exprToAssign, i);
 
 Review comment:
   `inputVariable.getHolder()` can be replaced to a local variable 
`exprToAssign`.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Read Hive union w/o nulls
> -------------------------
>
>                 Key: DRILL-7254
>                 URL: https://issues.apache.org/jira/browse/DRILL-7254
>             Project: Apache Drill
>          Issue Type: Sub-task
>            Reporter: Igor Guzenko
>            Assignee: Igor Guzenko
>            Priority: Major
>              Labels: doc-impacting
>             Fix For: 1.17.0
>
>




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

Reply via email to