Steve Carlin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24781 )
Change subject: IMPALA-15312: Say when HBO changed a join's build side ...................................................................... IMPALA-15312: Say when HBO changed a join's build side IMPALA-15236 puts the provenance of an HBO cardinality next to the number: the strategy that matched, the hash key, the estimate the planner computed itself and the ratio between the two. That says where the number came from, not whether it changed anything. Join inversion is where the two come apart. Planner.invertJoins() weighs the two inputs by cardinality, row size and parallelism, so a corrected estimate can flip the verdict while the shape of the plan, its operator counts and its node ids all stay put. On an outer-join-heavy report this turned sixty joins from RIGHT OUTER back to LEFT OUTER, and comparing the two plans by operator counts called them identical. Run the same cost model a second time on the estimates the planner computed for the two inputs, and record the outcome on the join when the verdicts differ. At EXTENDED and above the join then prints HBO chose the build side: without it this join would have been inverted The comparison is local. A match further down the tree is already folded into both numbers, so this answers "did the substitution on an input decide this", not "would the plan differ under use_hbo_stats=false" - the second question needs a second planning pass, which is more than a detail line is worth. Testing: - New HboJoinInversionTest, three cases: no match leaves no note; a seeded match that removes an inversion is recorded and printed; the line stays out of the default explain level. The history is seeded directly, so the tests do not depend on an earlier run. Change-Id: Ifc9517936c3f93865917a5f3fa3924c641374fcd Assisted-by: claude-opus-5 (Claude Code) Reviewed-on: http://gerrit.cloudera.org:8080/24781 Tested-by: Michael Smith <[email protected]> Reviewed-by: Michael Smith <[email protected]> Reviewed-by: Steve Carlin <[email protected]> --- M fe/src/main/java/org/apache/impala/planner/JoinNode.java M fe/src/main/java/org/apache/impala/planner/PlanNode.java M fe/src/main/java/org/apache/impala/planner/Planner.java A fe/src/test/java/org/apache/impala/planner/HboJoinInversionTest.java 4 files changed, 262 insertions(+), 5 deletions(-) Approvals: Michael Smith: Looks good to me, but someone else must approve; Verified Steve Carlin: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/24781 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ifc9517936c3f93865917a5f3fa3924c641374fcd Gerrit-Change-Number: 24781 Gerrit-PatchSet: 3 Gerrit-Owner: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]>
