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

Storages: Fix obtaining incorrect column information when there are virtual columns in the query (#9189) #9208

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #9189

What problem does this PR solve?

Issue Number: close #9188

Problem Summary:
When parsing some column expressions, it may need to use column index to obtain column information, but since virtual columns are filtered out before being sent to the storage layer, the original columns and the columns for storage to read are
inconsistency.

What is changed and how it works?

1. Use the original columns  in `query_info.dag_query` instead of `columns_to_read` when building `RSOperator`.
2. For runtime filters, creating the `DM::Attr` object in `StorageDeltaMerge::read`, so it doesn't need to rely on `column_to_read`.
  1. Currently, if a query contains virtual columns, hash join will not be pushed down to TiFlash. So in fact, runtime filters will not occur when a query contains virtual columns. But in order to keep the relevant codes consistent, make them not rely on columns_to_read, the way that runtime filters creating DM::Attr object is modified.

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

Fix obtaining incorrect column information when there are virtual columns in the query.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR. labels Jul 9, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 9, 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 lidezhu 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

@ti-chi-bot ti-chi-bot added cherry-pick-approved Cherry pick PR approved by release team. labels Jul 9, 2024
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed do-not-merge/cherry-pick-not-approved size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 9, 2024
@JinheLin
Copy link
Contributor

Replace by #9267

@JinheLin JinheLin closed this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants