expression: simplify the code with the ExtractColumnsFromExpressions (#62825)
This is an automated cherry-pick of #62825
What problem does this PR solve?
Issue Number: ref https://github.com/pingcap/tidb/issues/63810
Problem Summary:
What changed and how does it work?
ExtractColumnsFromExpressions has been able to remove duplicates. In this PR, we enhence this function to make it reusing the memory and avoid allocating the slices.
Check List
Tests
- [x] Unit test
- [ ] Integration test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test
- [ ] I checked and no code files have been changed.
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
Please refer to Release Notes Language Style Guide to write a quality release note.
None
@hawkingrei This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.
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.
Codecov Report
:x: Patch coverage is 91.66667% with 12 lines in your changes missing coverage. Please review.
:warning: Please upload report for BASE (release-8.5@f5289a7). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@
## release-8.5 #64781 +/- ##
================================================
Coverage ? 76.6178%
================================================
Files ? 1672
Lines ? 463661
Branches ? 0
================================================
Hits ? 355247
Misses ? 86765
Partials ? 21649
| Flag | Coverage Δ | |
|---|---|---|
| integration | 49.7080% <89.5833%> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 52.9278% <0.0000%> (?) |
|
| parser | ∅ <0.0000%> (?) |
|
| br | 57.1951% <0.0000%> (?) |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: hawkingrei Once this PR has been reviewed and has the lgtm label, please assign windtalker for approval. For more information see the Code Review Process. Please ensure that each of them provides their approval before proceeding.
The full list of commands accepted by this bot can be found here.
- pkg/expression/OWNERS
- ~~pkg/planner/OWNERS~~ [hawkingrei]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[LGTM Timeline notifier]
Timeline:
2025-12-12 10:18:35.457001343 +0000 UTC m=+1209060.270778915: :ballot_box_with_check: agreed by hawkingrei.
/test unit-test
@EmmaDuDu: No presubmit jobs available for pingcap/[email protected]
In response to this:
/test unit-test
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 kubernetes-sigs/prow repository.
@ti-chi-bot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| idc-jenkins-ci-tidb/unit-test | 61a535f9365fc4e91f0003a0e814c337b8a10ec2 | link | true | /test unit-test |
Full PR test history. Your PR dashboard.
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 kubernetes-sigs/prow repository. I understand the commands that are listed here.