Skip to content

[refactor](Descriptor) remove TupleDescriptor's TableRefInfo#62290

Open
morrySnow wants to merge 1 commit intoapache:masterfrom
morrySnow:tuple-desc-ref
Open

[refactor](Descriptor) remove TupleDescriptor's TableRefInfo#62290
morrySnow wants to merge 1 commit intoapache:masterfrom
morrySnow:tuple-desc-ref

Conversation

@morrySnow
Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@morrySnow
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@morrySnow
Copy link
Copy Markdown
Contributor Author

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Found 1 issue that should be fixed before merge.\n\n1. : removing handling from is not behavior-preserving. intentionally seeds from for SQL like (), but still recomputes partitions via . After this change that recomputation always starts from , so the manual partition subset is dropped and the scan can touch partitions outside the user-specified list.\n\nCritical checkpoint conclusions:\n- Goal of current task: not met safely; the refactor removes stored , but it also changes OLAP partition-pruning behavior, and there is no test proving equivalence.\n- Modification size/focus: small, but not behavior-preserving because planner state was removed from a path that still depended on it.\n- Concurrency: no new concurrency concerns in the changed code.\n- Lifecycle/static initialization: not involved.\n- Configuration: no config changes.\n- Compatibility: no FE/BE protocol or storage-format incompatibility identified.\n- Parallel code paths: not all relevant paths were updated; the Nereids explicit-partition/lazy range-evaluation path still needs the preserved partition subset.\n- Special conditional checks: the removed partition-name restriction was semantically necessary and now has no replacement.\n- Test coverage: missing targeted coverage for explicit queries on this path.\n- Observability: no additional observability needed for this refactor.\n- Transaction/persistence: not involved.\n- Data writes/modifications: not involved.\n- FE/BE variable passing: not involved.\n- Performance: neutral/slightly simpler, but correctness regression outweighs it.\n- Other issues: none beyond the partition-selection regression were confirmed.

// Step1: compute partition ids
PartitionNamesInfo partitionNames = desc.getRef().getPartitionNamesInfo();
PartitionInfo partitionInfo = olapTable.getPartitionInfo();
if (partitionInfo.getType() == PartitionType.RANGE || partitionInfo.getType() == PartitionType.LIST) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This drops the only FE-side restriction that preserves explicitly specified partitions when recomputes partition ids. Nereids still builds with for queries like (), and later calls . After this change, that method always starts from all partitions, so the manual partition subset is lost on this path. Please keep the explicit-partition filter here, or preserve the preselected partition set when recomputing.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Found 1 issue that should be fixed before merge.

  1. fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java: removing explicit partition filtering from computePartitionInfo is not behavior preserving. LogicalOlapScan intentionally seeds selectedPartitionIds from specifiedPartitions for SQL like SELECT * FROM t PARTITION p1, but OlapScanNode.lazyEvaluateRangeLocations still recomputes partitions via computePartitionInfo. After this change that recomputation always starts from all partitions, so the manual partition subset is dropped and the scan can touch partitions outside the user specified list.

Critical checkpoint conclusions:

  • Goal of current task: not met safely; the refactor removes stored TableRefInfo, but it also changes OLAP partition pruning behavior, and there is no test proving equivalence.
  • Modification size and focus: small, but not behavior preserving because planner state was removed from a path that still depended on it.
  • Concurrency: no new concurrency concerns in the changed code.
  • Lifecycle or static initialization: not involved.
  • Configuration: no config changes.
  • Compatibility: no FE or BE protocol or storage format incompatibility identified.
  • Parallel code paths: not all relevant paths were updated; the Nereids explicit partition lazy range evaluation path still needs the preserved partition subset.
  • Special conditional checks: the removed partition name restriction was semantically necessary and now has no replacement.
  • Test coverage: missing targeted coverage for explicit PARTITION queries on this path.
  • Observability: no additional observability needed for this refactor.
  • Transaction and persistence: not involved.
  • Data writes and modifications: not involved.
  • FE to BE variable passing: not involved.
  • Performance: neutral to slightly simpler, but correctness regression outweighs it.
  • Other issues: none beyond the partition selection regression were confirmed.

// Step1: compute partition ids
PartitionNamesInfo partitionNames = desc.getRef().getPartitionNamesInfo();
PartitionInfo partitionInfo = olapTable.getPartitionInfo();
if (partitionInfo.getType() == PartitionType.RANGE || partitionInfo.getType() == PartitionType.LIST) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This drops the only FE side restriction that preserves explicitly specified partitions when OlapScanNode recomputes partition ids. Nereids still builds LogicalOlapScan with selectedPartitionIds equal to specifiedPartitions for queries like SELECT * FROM t PARTITION p1, and lazyEvaluateRangeLocations later calls computePartitionInfo. After this change, that method always starts from all partitions, so the manual partition subset is lost on this path. Please keep the explicit partition filter here, or preserve the preselected partition set when recomputing.

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 45.45% (5/11) 🎉
Increment coverage report
Complete coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants