Aman Sinha has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17387
Change subject: IMPALA-10681: [WIP] Fix join cardinality if one side is scalar ...................................................................... IMPALA-10681: [WIP] Fix join cardinality if one side is scalar During cardinality estimation for inner joins, if the join conjunct involves a scan slot on left side and a function (e.g MAX) on the right, currently we determine that the NDV stats of either side is not useful and return the left side's cardinality even though it may be a significant over-estimate. This patch fixes the behavior by keeping track of left and right side's scan slots and as long as one side is valid scan slot and the other side is scalar, we compute the cardinality as card(lhs)/ndv(lhs) (here lhs = left hand side and corresponds to the scan slot) Testing: - Added planner test for inner join cardinality TODO: run all FE tests Change-Id: I8aa9d3b8f3c4848b3e9414fe19ad7ad348d12ecc --- M fe/src/main/java/org/apache/impala/planner/JoinNode.java M testdata/workloads/functional-planner/queries/PlannerTest/card-inner-join.test 2 files changed, 107 insertions(+), 12 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/87/17387/1 -- To view, visit http://gerrit.cloudera.org:8080/17387 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8aa9d3b8f3c4848b3e9414fe19ad7ad348d12ecc Gerrit-Change-Number: 17387 Gerrit-PatchSet: 1 Gerrit-Owner: Aman Sinha <amsi...@cloudera.com>