deniskuzZ commented on code in PR #6946:
URL: https://github.com/apache/hive/pull/6946#discussion_r4695735183


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFOperator.java:
##########
@@ -325,6 +325,8 @@ protected void initializeOp(Configuration hconf) throws 
HiveException {
     evaluators = VectorPTFDesc.getEvaluators(vectorDesc, vectorPTFInfo);
     for (VectorPTFEvaluatorBase evaluator : evaluators) {
       evaluator.setNullsLast(HiveConf.getBoolVar(hconf, 
HiveConf.ConfVars.HIVE_DEFAULT_NULLS_LAST));
+      // Evaluated in process(), which needs its transient state (e.g. a 
cast's target type).
+      VectorExpression.doTransientInit(evaluator.inputVecExpr, hconf);

Review Comment:
   This also fixes a wrong-results bug in released versions, not only a 
prerequisite for ntile. In 4.0.0–4.2.1, vectorized sum(cast(s as int)) over 
(...) silently returns NULL: CastStringToLong sets  integerPrimitiveCategory 
only in transientInit, and the resulting NPE is caught and written as NULL. 
   
   Could you open a bug JIRA for it and link it from HIVE-30162, so it shows up 
in release notes and can be backported? Please also update the "user-facing 
change: No" section of the description.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to