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

support selective block for MPPExchangeWriter #9195

Merged
merged 19 commits into from
Jul 19, 2024

Conversation

guo-shaoge
Copy link
Contributor

@guo-shaoge guo-shaoge commented Jul 8, 2024

What problem does this PR solve?

Issue Number: ref #9196

Problem Summary:

What is changed and how it works?

This is part of auto pass through hashagg. We need selective block because AutoPassThroughBlockInputStream may output selective block(only subset of rows are effective).

  1. add selective block version of IColumn::updateWeakHash32(), IColumn:scatter() and IColumn::scatterTo()
  2. support selective block for FineGrainedWriter and HashPartitionWriter

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

None

Signed-off-by: guo-shaoge <shaoge1994@163.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 8, 2024
@guo-shaoge guo-shaoge mentioned this pull request Jul 8, 2024
4 tasks
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
dbms/src/Columns/ColumnAggregateFunction.cpp Outdated Show resolved Hide resolved
dbms/src/Columns/ColumnAggregateFunction.cpp Show resolved Hide resolved
dbms/src/Columns/ColumnDecimal.cpp Outdated Show resolved Hide resolved
dbms/src/Columns/ColumnString.cpp Show resolved Hide resolved
size_t rows = 0;
if constexpr (selective_block)
{
RUNTIME_CHECK(block.info.selective && !block.info.selective->empty());
Copy link
Contributor

Choose a reason for hiding this comment

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

why need to throw error if selective->empty() is true? Seems this function does not assume input block is not empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The next PR will make sure every block.info.selective is filled with data.

Copy link
Contributor

Choose a reason for hiding this comment

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

but I think just check block.info.selective is enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If block.info.selective->empty() is true, it means it's an empty block.
The code path shouldn't reach here.

dbms/src/Flash/Mpp/FineGrainedShuffleWriter.h Show resolved Hide resolved
dbms/src/Flash/Mpp/HashBaseWriterHelper.cpp Show resolved Hide resolved
dbms/src/Flash/Mpp/newMPPExchangeWriter.h Outdated Show resolved Hide resolved
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge guo-shaoge requested a review from gengliqi July 15, 2024 08:35
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 16, 2024
Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

ti-chi-bot bot commented Jul 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gengliqi, windtalker

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:
  • OWNERS [gengliqi,windtalker]

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 Jul 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-16 07:04:36.300602793 +0000 UTC m=+337498.291544262: ☑️ agreed by gengliqi.
  • 2024-07-18 01:40:52.065232042 +0000 UTC m=+490874.056173511: ☑️ agreed by windtalker.

@guo-shaoge
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 9de3fdc into pingcap:master Jul 19, 2024
5 checks passed
@JaySon-Huang JaySon-Huang deleted the selective_block branch July 19, 2024 05:13
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. 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.

3 participants