Skip to content

[core] Minor refactor partition predicates in FallbackReadScan#7950

Merged
JingsongLi merged 2 commits into
apache:masterfrom
juntaozhang:pr-refactor-FallbackReadScan
May 27, 2026
Merged

[core] Minor refactor partition predicates in FallbackReadScan#7950
JingsongLi merged 2 commits into
apache:masterfrom
juntaozhang:pr-refactor-FallbackReadScan

Conversation

@juntaozhang
Copy link
Copy Markdown
Contributor

@juntaozhang juntaozhang commented May 25, 2026

Purpose

This PR is a prerequisite for [spark] Support compact_chain_table procedure.

FallbackReadScan currently uses a single partitionPredicate for both main and fallback scans. However, in chain table compaction scenarios, we need to apply different
partition filters to the main (snapshot) branch and the fallback (delta) branch. For example, when overwriting an existing partition, we need to:

  • Exclude the target partition from the main scan
  • Include only the target partition in the fallback scan

This PR refactors FallbackReadScan to support separate partition predicates for main and fallback scans.

Tests

  • FallbackReadFileStoreTableTest.testMainAndFallbackPartitionPredicates

scan.withPartitionFilter(scanPartitionPredicate);
if (isMain && getMainPartitionPredicate() != null) {
scan.withPartitionFilter(getMainPartitionPredicate());
} else if (getFallbackPartitionPredicate() != null) {
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.

No !isMain &&? Please add test for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot for your review. The testMainAndFallbackPartitionPredicates has already been added.

@juntaozhang juntaozhang force-pushed the pr-refactor-FallbackReadScan branch from 398e99c to fdfc312 Compare May 25, 2026 12:10
@juntaozhang juntaozhang requested a review from JingsongLi May 26, 2026 10:10
Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 4050509 into apache:master May 27, 2026
12 checks passed
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