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 (release-8.1) #9265

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

JinheLin
Copy link
Contributor

This is an manual 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.

…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]>
@ti-chi-bot ti-chi-bot bot added do-not-merge/cherry-pick-not-approved release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 29, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 29, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed do-not-merge/cherry-pick-not-approved labels Jul 29, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 30, 2024
@JaySon-Huang
Copy link
Contributor

/run-all-tests

1 similar comment
@JinheLin
Copy link
Contributor Author

/run-all-tests

@JinheLin
Copy link
Contributor Author

/run-all-tests

@JinheLin
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot bot added the lgtm label Jul 30, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, 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 [JaySon-Huang,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 30, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 30, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-30 03:59:32.903106876 +0000 UTC m=+241889.183154942: ☑️ agreed by JaySon-Huang.
  • 2024-07-30 10:24:12.11537241 +0000 UTC m=+264968.395420480: ☑️ agreed by Lloyd-Pottiger.

@ti-chi-bot ti-chi-bot bot merged commit 2930f3e into release-8.1 Jul 30, 2024
5 checks passed
@ti-chi-bot ti-chi-bot bot deleted the cp-9189 branch July 30, 2024 10:29
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants