ggangadharan commented on code in PR #6946:
URL: https://github.com/apache/hive/pull/6946#discussion_r4702932889
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java:
##########
@@ -3013,11 +3013,18 @@ private boolean validatePTFOperator(PTFOperator op,
VectorizationContext vContex
throw new RuntimeException("Unexpected window type " +
windowFrameDef.getWindowType());
}
- // Row mode also accepts a non-constant ntile argument (read from the
first row of the partition).
- if (supportedFunctionType == SupportedFunctionType.NTILE &&
- !isPositiveIntConstant(singleExprNodeDesc)) {
- setOperatorIssue(functionName + " only supports a positive integer
constant number of buckets");
- return false;
+ // A non-constant ntile argument is read from the first row of each
partition, as in row mode.
+ if (supportedFunctionType == SupportedFunctionType.NTILE) {
Review Comment:
Done. NTILE is out of COLUMN_AGNOSTIC_FUNCTIONS, and the comment there is
back to the original.
The NTILE branch now only checks for a non-positive constant; the generic
block below handles lead/lag and the type check, with the same message as
before, so no golden output changed.
NTILE is an explicit exception in evaluatorArgsReferencePartitionOnlyExprs,
because it reads its argument only from forwarded batches, where the partition
columns are restored. Hence replaced the TODO on
hasUnbufferedPartitionColumnInEvaluatorArgs with a comment describing that
opt-in. ntile(k) over (partition by k ...) is still vectorized.
--
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]