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) #9206

Merged

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.

@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.5 This PR is cherry-picked to release-7.5 from a source PR. labels Jul 9, 2024
@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. size/XL Denotes a PR that changes 500-999 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 9, 2024
@JinheLin
Copy link
Contributor

/run-all-tests

@JinheLin JinheLin force-pushed the cherry-pick-9189-to-release-7.5 branch from 5a68f44 to 55055ec Compare July 10, 2024 08:50
@JinheLin
Copy link
Contributor

/run-all-tests

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 11, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Jul 11, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JinheLin, Lloyd-Pottiger

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 [JinheLin,Lloyd-Pottiger]

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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 11, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-11 08:05:19.332551249 +0000 UTC m=+517616.567785359: ☑️ agreed by JinheLin.
  • 2024-07-11 08:30:47.081313362 +0000 UTC m=+519144.316547476: ☑️ agreed by Lloyd-Pottiger.

@ti-chi-bot ti-chi-bot bot merged commit be98d2d into pingcap:release-7.5 Jul 11, 2024
5 checks passed
JinheLin added a commit that referenced this pull request Jul 29, 2024
…irtual columns in the query (#9189) (#9206)

close #9188

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`.

Signed-off-by: ti-chi-bot <[email protected]>

Co-authored-by: jinhelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm 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.5 This PR is cherry-picked to release-7.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants