Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/21961 )
Change subject: IMPALA-13468: Fix various aggregation issues in aggregation.test ...................................................................... Patch Set 6: (6 comments) http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/FunctionResolver.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/FunctionResolver.java: http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/FunctionResolver.java@179 PS6, Line 179: if (lowercaseName.toLowerCase().equals("grouping_id")) { nit: toLowerCase seems redundant when the argument name is lowercaseName. http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/FunctionResolver.java@181 PS6, Line 181: "grouping_id", impalaArgTypes, Type.BIGINT, true, false, true); nit: this could be lowercaseName instead of repeating the literal string. Makes it easier to generalize if we find other cases. http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java: http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java@96 PS6, Line 96: List<RelDataType> operandTypes = new ArrayList<>(); nit: could optimize by specifying the initial capacity new ArrayList<>(opBinding.getOperandCount()); http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java@127 PS6, Line 127: // return false if all operand types are not nullable. Else return true. I think this would be clearer if it said "return true if any operand types are nullable". Fewer negatives, and threw me for a loop for a minute because a more common pattern is to return true if all types match predicate. nit: Could also implement using anyMatch return operandTypes.stream().anyMatch(rdt -> rdt.isNullable()); http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAggOperator.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAggOperator.java: http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaAggOperator.java@35 PS6, Line 35: * class. Do they really match specific classes, rather than instanceof? Seems like a big limitation on modularity. http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java: http://gerrit.cloudera.org:8080/#/c/21961/6/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCustomOperatorTable.java@a86 PS6, Line 86: This seems to have mutated somewhat when it was moved to CommonOperatorFunctions. What changed? -- To view, visit http://gerrit.cloudera.org:8080/21961 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I038127d6a2f228ae8d263e983b1906e99ae05f77 Gerrit-Change-Number: 21961 Gerrit-PatchSet: 6 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Anonymous Coward (816) Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]> Gerrit-Comment-Date: Tue, 29 Oct 2024 20:29:33 +0000 Gerrit-HasComments: Yes
