ggangadharan commented on code in PR #6861:
URL: https://github.com/apache/hive/pull/6861#discussion_r4270448722
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java:
##########
@@ -5042,6 +5050,14 @@ private static ExprNodeDesc[]
getOrderExprNodeDescs(List<OrderExpressionDef> ord
return exprNodeDescs;
}
+ private static boolean isPositiveIntConstant(ExprNodeDesc exprNodeDesc) {
+ if (!(exprNodeDesc instanceof ExprNodeConstantDesc)) {
+ return false;
+ }
+ Object value = ((ExprNodeConstantDesc) exprNodeDesc).getValue();
+ return value instanceof Integer && (Integer) value > 0;
Review Comment:
Only int can reach this point: GenericUDAFNTile.getEvaluator rejects any
other argument type during semantic analysis ("Number of tiles must be an int
expression"). I checked ntile(4Y), ntile(4S) and ntile(4L) (all rejected before
vectorization) and ntile(2 + 2) (folds to an int constant and vectorizes).
Keeping the Integer check.
--
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]