Skip to content

Conversation

@emilie-wang
Copy link
Contributor

Closes 2562

Rationale for this change

Allow users to query specific partitions with predicate while inspecting table partitions.
As suggested, add a predicate as an argument into table.inspect.partitions() that defaults to ALWAYS_TRUE.

Are these changes tested?

Yes, new integration tests added.

Are there any user-facing changes?

I believe no.

Allow users to filter partitions using expressions when inspecting table partitions, similar to scan planning.

def plan_files(self) -> Iterable[FileScanTask]:
"""Plans the relevant files by filtering on the PartitionSpecs.
def scan_plan_helper(self) -> Iterator[ManifestEntry]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I refactored this part so that it can be reused in inspect.partitions(), but not sure if it is the best way.
could you please let me know your thoughts @Fokko? Thanks! And the name is terrible and I could rework on it.

@emilie-wang
Copy link
Contributor Author

Hi @Fokko sorry to ping you and I did a few updates after the initial commit and would like to have your feedbacks. Thanks a lot!

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

@emilie-wang Sorry for the late reply, this looks great to me 👍

@Fokko Fokko merged commit d99936a into apache:main Oct 17, 2025
10 checks passed
@emilie-wang emilie-wang deleted the hanzhi/partitions-filter branch October 17, 2025 18:14
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.

Looking for efficient way to query specific partitions from metadata

2 participants