Bharath Vissapragada has posted comments on this change. ( http://gerrit.cloudera.org:8080/11901 )
Change subject: IMPALA-7528: Fix division by zero when computing cardinalities ...................................................................... Patch Set 2: Code-Review+1 (3 comments) Tim can you +2? http://gerrit.cloudera.org:8080/#/c/11901/1/fe/src/main/java/org/apache/impala/planner/JoinNode.java File fe/src/main/java/org/apache/impala/planner/JoinNode.java: http://gerrit.cloudera.org:8080/#/c/11901/1/fe/src/main/java/org/apache/impala/planner/JoinNode.java@368 PS1, Line 368: long joinCard = Math.round((lhsCard / Math.max(1, Math.max(lhsAdjNdv, rhsAdjNdv))) * > We don't know for sure it's zero. I think mostly NDV == 0 occurs if there a Ah, outer joins. I thought this code path was inner joins only, for some reason. makes sense. http://gerrit.cloudera.org:8080/#/c/11901/2/fe/src/main/java/org/apache/impala/planner/JoinNode.java File fe/src/main/java/org/apache/impala/planner/JoinNode.java: http://gerrit.cloudera.org:8080/#/c/11901/2/fe/src/main/java/org/apache/impala/planner/JoinNode.java@367 PS2, Line 367: if (slots.rhsNumRows() > rhsCard) rhsAdjNdv *= rhsCard / slots.rhsNumRows(); nit: Add a comment that explains adjusting to 1 part. It is a bit subtle. http://gerrit.cloudera.org:8080/#/c/11901/2/fe/src/test/java/org/apache/impala/planner/PlannerTest.java File fe/src/test/java/org/apache/impala/planner/PlannerTest.java: http://gerrit.cloudera.org:8080/#/c/11901/2/fe/src/test/java/org/apache/impala/planner/PlannerTest.java@708 PS2, Line 708: testCardinalityDivisionByZero nit: rename this to testNullColumnJoinCardinality() or something? -- To view, visit http://gerrit.cloudera.org:8080/11901 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieedd51d3ad6131a4ea2a5883f05104e6a0f2cd14 Gerrit-Change-Number: 11901 Gerrit-PatchSet: 2 Gerrit-Owner: Bikramjeet Vig <bikramjeet....@cloudera.com> Gerrit-Reviewer: Bharath Vissapragada <bhara...@cloudera.com> Gerrit-Reviewer: Bikramjeet Vig <bikramjeet....@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-Comment-Date: Thu, 08 Nov 2018 01:05:54 +0000 Gerrit-HasComments: Yes