asolimando commented on code in PR #3637:
URL: https://github.com/apache/hive/pull/3637#discussion_r1000687733
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java:
##########
@@ -4635,7 +4636,26 @@ public static
ImmutablePair<VectorAggregationDesc,String> getVectorAggregationDe
"and output type: \"" + outputColVectorType + "\" " +
"and mode: " + udafEvaluatorMode + " not supported for " +
"evaluator " + evaluator.getClass().getSimpleName();
- return new ImmutablePair<VectorAggregationDesc,String>(null, issue);
+ return new ImmutablePair<>(null, issue);
+ }
+
+ private static List<ConstantVectorExpression> getConstantParams(
+ VectorizationContext vContext, List<ExprNodeDesc> parameterList) throws
HiveException {
+ if (parameterList.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ final List<ConstantVectorExpression> res = new
ArrayList<>(parameterList.size() - 1);
+
+ // skip the first parameter as it is not a constant
+ for (ExprNodeDesc exprNodeDesc : parameterList.subList(1,
parameterList.size())) {
Review Comment:
I gave it a try but I prefer a classic for loop when the body is too complex
like in this case.
I also considered just using
`parameterList.stream().skip(1).collect(Collectors.toList())` but it's less
clear than the original statement, so if you don't feel strongly about this,
I'd rather keep this part of the code as-is.
--
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]