Skip to content
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

executor: add hash join v2 #53208

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

Conversation

windtalker
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #53127

Problem Summary:

What changed and how does it work?

Design doc: #53196
Currently, only inner join and left outer join is supported.

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/invalid-title release-note-none size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. sig/planner SIG: Planner labels May 13, 2024
Copy link

tiprow bot commented May 13, 2024

Hi @windtalker. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@windtalker windtalker changed the title Hash join v2 unsafe pointer executor: add hash join v2 May 13, 2024
@windtalker windtalker mentioned this pull request May 13, 2024
13 tasks
// See the License for the specific language governing permissions and
// limitations under the License.

package join
Copy link
Member

Choose a reason for hiding this comment

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

Nothing? Can we remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add a basic test

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 8.68317% with 2545 lines in your changes are missing coverage. Please review.

Project coverage is 48.8141%. Comparing base (0afe54d) to head (61cc71c).

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #53208         +/-   ##
=================================================
- Coverage   72.5179%   48.8141%   -23.7038%     
=================================================
  Files          1505       1423         -82     
  Lines        429866     409004      -20862     
=================================================
- Hits         311730     199652     -112078     
- Misses        98820     191337      +92517     
+ Partials      19316      18015       -1301     
Flag Coverage Δ
integration 48.8141% <8.6831%> (?)
tiprow_ft ?
unit ?

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

Components Coverage Δ
dumpling ∅ <ø> (∅)
parser ∅ <ø> (∅)
br 24.0471% <ø> (-17.3263%) ⬇️

@windtalker windtalker added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2024
@hawkingrei
Copy link
Member

/ok-to-test

BuildWorkers: make([]*join.BuildWorkerV2, v.Concurrency),
HashJoinCtxV2: &join.HashJoinCtxV2{
OtherCondition: v.OtherConditions,
PartitionNumber: mathutil.Min(int(v.Concurrency), 16),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
PartitionNumber: mathutil.Min(int(v.Concurrency), 16),
PartitionNumber: min(int(v.Concurrency), 16),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@windtalker windtalker force-pushed the hash_join_v2_unsafe_pointer branch from 811ae7b to b8de444 Compare May 15, 2024 02:21
@windtalker windtalker changed the title executor: add hash join v2 executor: add hash join v2 | tidb-test=pr/2332 May 15, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2024
@windtalker windtalker force-pushed the hash_join_v2_unsafe_pointer branch from 668ff10 to 6f78742 Compare May 16, 2024 01:47
@windtalker
Copy link
Contributor Author

/test check-dev2

Copy link

tiprow bot commented May 16, 2024

@windtalker: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test check-dev2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@windtalker windtalker force-pushed the hash_join_v2_unsafe_pointer branch from 207cd7a to 43644ee Compare May 17, 2024 02:04
Copy link

ti-chi-bot bot commented May 17, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign fixdb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@windtalker windtalker force-pushed the hash_join_v2_unsafe_pointer branch from 43644ee to 150fdb7 Compare May 17, 2024 06:41
@windtalker
Copy link
Contributor Author

/test unit-test

Copy link

tiprow bot commented May 17, 2024

@windtalker: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test tidb_parser_test

Use /test all to run all jobs.

In response to this:

/test unit-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@windtalker windtalker force-pushed the hash_join_v2_unsafe_pointer branch from 4403be5 to 3d78136 Compare May 20, 2024 07:07
@windtalker windtalker changed the title executor: add hash join v2 | tidb-test=pr/2332 executor: add hash join v2 May 22, 2024
windtalker and others added 3 commits May 22, 2024 13:15
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufei@pingcap.com>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
@windtalker windtalker force-pushed the hash_join_v2_unsafe_pointer branch from 3d78136 to 61cc71c Compare May 22, 2024 05:41
Copy link

tiprow bot commented May 22, 2024

@windtalker: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 61cc71c link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link

ti-chi-bot bot commented May 22, 2024

@windtalker: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/unit-test 61cc71c link true /test unit-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

// step 1. fetch data from build side child and build a hash table;
// step 2. fetch data from probe child in a background goroutine and probe the hash table in multiple join workers.
func (e *HashJoinV2Exec) Next(ctx context.Context, req *chunk.Chunk) (err error) {
if !e.prepared {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use atomic type for e.prepared? As Close may be called at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test release-note-none sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants