Skip to content

[Append Scan] Extract manifest group planning into separate class #2232

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smaheshwar-pltr
Copy link
Contributor

@smaheshwar-pltr smaheshwar-pltr commented Jul 22, 2025

Rationale for this change

Split up from incremental append scan work - see #2031 (comment). PyIceberg doesn't support incremental reading of appended data between snapshots, like Spark does.

This PR introduces a ManifestGroupPlanner to hold the logic of using manifests to plan the files for a table scan. This allows this logic to be re-used across scans. The IncrementalAppendScan will also use this (see #2234).

Are these changes tested?

N / A

Are there any user-facing changes?

Yes, see #2232 (comment).

Comment on lines +1832 to +1834
@property
def partition_filters(self) -> KeyDefaultDict[int, BooleanExpression]:
return self._manifest_planner.partition_filters
Copy link
Contributor Author

@smaheshwar-pltr smaheshwar-pltr Jul 22, 2025

Choose a reason for hiding this comment

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

Keeping this public method around to not introduce a breaking change to DataScan. On the other hand, the private methods have been moved into ManifestGroupPlanner. Technically, that could still break users subclassing DataScan and calling the removed methods in the subclass (and also users accessing those private methods, but that feels more OK to break than the subclassing case).

I'm not familiar with PyIceberg breaks / deprecations - would it be fine to remove these private methods or is a deprecation cycle still required?

@@ -2075,6 +1957,160 @@ def count(self) -> int:
return res


class ManifestGroupPlanner:
Copy link
Contributor Author

@smaheshwar-pltr smaheshwar-pltr Jul 22, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's also to share this logic between scans like DataScan and IncrementalAppendScan, that both use this flow.

@smaheshwar-pltr smaheshwar-pltr marked this pull request as ready for review July 22, 2025 13:36
case_sensitive=self.case_sensitive,
schema=self.table_metadata.schema(),
)
def _manifest_planner(self) -> ManifestGroupPlanner:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could also be a field on the class set in the constructor. Kept the diff smaller here, but happy to change

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.

1 participant