Skip to content

planner: fix doesn't push down hash join to tiflash #60436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Apr 8, 2025

What problem does this PR solve?

Issue Number: close #60407

Problem Summary:

What changed and how does it work?

caused by #57417

because NeedMPPExchangeByEquivalence will change the hash partitioning information. Having different numbers of MPP partitions in the child nodes of a join can lead to invalid tasks, which ultimately result in incorrect plan.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 8, 2025
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 73.07692% with 7 lines in your changes missing coverage. Please review.

Project coverage is 73.5364%. Comparing base (2c103b4) to head (20c8f8e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #60436        +/-   ##
================================================
+ Coverage   73.0851%   73.5364%   +0.4512%     
================================================
  Files          1715       1715                
  Lines        475095     475355       +260     
================================================
+ Hits         347224     349559      +2335     
+ Misses       106494     104411      -2083     
- Partials      21377      21385         +8     
Flag Coverage Δ
integration 42.6911% <0.0000%> (?)
unit 72.3651% <73.0769%> (+0.0517%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.6553% <ø> (ø)
parser ∅ <ø> (∅)
br 47.2937% <ø> (+0.0332%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei requested review from Copilot and AilinKid and removed request for Copilot April 11, 2025 05:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • pkg/planner/core/casetest/tpch/BUILD.bazel: Language not supported
  • pkg/planner/core/casetest/tpch/testdata/tpch_suite_in.json: Language not supported
  • pkg/planner/core/casetest/tpch/testdata/tpch_suite_out.json: Language not supported

@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei requested a review from winoros April 11, 2025 06:47
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 15, 2025
@hawkingrei
Copy link
Member Author

/retest

1 similar comment
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei force-pushed the tpch_q9 branch 2 times, most recently from 20161ee to dd48c63 Compare April 16, 2025 02:24
@hawkingrei
Copy link
Member Author

/retest

Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 16, 2025
func (p *PhysicalHashJoin) enforceExchangerByBackup(task *MppTask, idx int, expectedCols int) *MppTask {
if backupHashProp := p.GetChildReqProps(idx); backupHashProp != nil {
if len(backupHashProp.MPPPartitionCols) == expectedCols {
return task.enforceExchangerImpl(backupHashProp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we first eliminate the ex and add it back if necessary. i afraid the complicated case, currently looks fine to me

Copy link

ti-chi-bot bot commented Apr 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, winoros

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 17, 2025
Copy link

ti-chi-bot bot commented Apr 17, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-16 16:09:19.257467292 +0000 UTC m=+2877452.941703373: ☑️ agreed by winoros.
  • 2025-04-17 02:21:06.449822355 +0000 UTC m=+2914160.134058451: ☑️ agreed by AilinKid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tpch-10 query-9 doesn't push down hash join to tiflash when allow_mpp and enforce_mpp is set on
3 participants