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 read(filter, true) in FilterBlockInputStream #6810

Conversation

Lloyd-Pottiger
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger commented Feb 13, 2023

Support read(filter, true) in FilterBlockInputStream and ExpressionBlockInputStream

Signed-off-by: Lloyd-Pottiger [email protected]

What problem does this PR solve?

Issue Number: ref #5829

Problem Summary:

What is changed and how it works?

  1. Support read(filter, true) in FilterBlockInputStream.
  2. remove some useless tests.
  3. remove useless projection in push down filter.

Why do this?

We will reuse the filter return by read(filter, true) to filter out unnesscessary data packs when doing late materialization.

Check List

Tests

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

replace Block readImpl() with

Block readImpl() override
{
Block res = readImpl(filter, true);
if (filter && res)
{
    size_t passed_rows = countBytesInFilter(*filter);
    for (auto & col : res)
    {
        col.column = col.column->filter(*filter, passed_rows);
    }
}
return res;
}

and run unit test ./dbms/gtests_dbms --gtest_filter="FilterExecutorTestRunner*"

  • 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: Lloyd-Pottiger <[email protected]>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 13, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SeaRise
  • ywqzzy

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 13, 2023
Signed-off-by: Lloyd-Pottiger <[email protected]>
@ywqzzy ywqzzy self-requested a review February 13, 2023 09:37
@Lloyd-Pottiger
Copy link
Contributor Author

/run-all-tests

Signed-off-by: Lloyd-Pottiger <[email protected]>
@Lloyd-Pottiger
Copy link
Contributor Author

/run-integration-test

Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
@Lloyd-Pottiger
Copy link
Contributor Author

/run-all-tests

Signed-off-by: Lloyd-Pottiger <[email protected]>
@Lloyd-Pottiger
Copy link
Contributor Author

/run-unit-test

Signed-off-by: Lloyd-Pottiger <[email protected]>
@Lloyd-Pottiger Lloyd-Pottiger changed the title Support read(filter, true) in FilterBlockInputStream and ExpressionBlockInputStream Support read(filter, true) in FilterBlockInputStream Feb 15, 2023
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 15, 2023
@Lloyd-Pottiger
Copy link
Contributor Author

/run-integration-test

Signed-off-by: Lloyd-Pottiger <[email protected]>
…hub.com:Lloyd-Pottiger/tiflash into support-return-filter-in-FilterBlockInputStream
Signed-off-by: Lloyd-Pottiger <[email protected]>
}
chain.getLastActions()->add(ExpressionAction::project(project_cols));
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer the original code.
Both have the same effect, but the original code is more readable.
Because the original code added the project action explicitly, instead of letting ExpressionActionChain::finalize add it implicitly.

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 original code get two same projection...

Copy link
Contributor

Choose a reason for hiding this comment

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

ok..

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

@SeaRise
Copy link
Contributor

SeaRise commented Feb 15, 2023

/cc @windtalker

Copy link
Contributor

@SeaRise SeaRise left a comment

Choose a reason for hiding this comment

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

Others LGTM

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 16, 2023
Signed-off-by: Lloyd-Pottiger <[email protected]>
@@ -13,14 +13,3 @@
# limitations under the License.

include_directories (${CMAKE_CURRENT_BINARY_DIR})
Copy link
Contributor

Choose a reason for hiding this comment

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

this useless CMakeLists.txt can also be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is a gtest left, can not removed.

Signed-off-by: Lloyd-Pottiger <[email protected]>
@Lloyd-Pottiger
Copy link
Contributor Author

/run-all-tests

@Lloyd-Pottiger
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@Lloyd-Pottiger: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 92c000d

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 16, 2023
@ti-chi-bot ti-chi-bot merged commit 47d4c8f into pingcap:master Feb 16, 2023
@Lloyd-Pottiger Lloyd-Pottiger deleted the support-return-filter-in-FilterBlockInputStream branch February 16, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants