Aman Sinha has posted comments on this change. ( http://gerrit.cloudera.org:8080/23513 )
Change subject: IMPALA-13695: Calcite planner: fix for ndv with 2 args ...................................................................... Patch Set 2: (4 comments) http://gerrit.cloudera.org:8080/#/c/23513/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceNodes.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceNodes.java: http://gerrit.cloudera.org:8080/#/c/23513/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceNodes.java@651 PS2, Line 651: int maxVal = Integer.MAX_VALUE; The comparison is being with Integer.MAX_VALUE which is 2^31 - 1 but the comment above says -1. Why not just compare with -1 ? http://gerrit.cloudera.org:8080/#/c/23513/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaNdvFunction.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaNdvFunction.java: http://gerrit.cloudera.org:8080/#/c/23513/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaNdvFunction.java@35 PS2, Line 35: if (callBinding.getOperandCount() == 1) { Here it checks for 1 or more arguments. What if it is 0 args ? e.g NDV() .. is that rejected before getting here ? Also, what if it is more than 2 arguments ? http://gerrit.cloudera.org:8080/#/c/23513/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaNdvFunction.java@41 PS2, Line 41: ndv nit: SQL functions should preferably be upper case in error messages or logs in order to distinguish from rest of the text. I doubt we follow this everywhere but it's a good convention. http://gerrit.cloudera.org:8080/#/c/23513/2/java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaNdvFunction.java@46 PS2, Line 46: ndv nit: same as above. -- To view, visit http://gerrit.cloudera.org:8080/23513 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82419f77e043e9975865a042ffb8db75a26931f7 Gerrit-Change-Number: 23513 Gerrit-PatchSet: 2 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Fang-Yu Rao <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Riza Suminto <[email protected]> Gerrit-Comment-Date: Wed, 15 Oct 2025 18:10:22 +0000 Gerrit-HasComments: Yes
