Skip to content
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

Core: Add a util to compute partition stats #11146

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

ajantha-bhat
Copy link
Member

Introduced two API's to compute and sort partition stats as per spec.

  • Iterable<PartitionStats> partitionStats = PartitionStatsUtil.computeStats(table, table.currentSnapshot());
  • PartitionStatsUtil.sortStats(partitionStats, Partitioning.partitionType(table));

These will be used by engines integrated with writer to compute and write the partition stats.

Copy link
Contributor

@aokolnychyi aokolnychyi left a comment

Choose a reason for hiding this comment

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

I like the new approach of collecting stats per manifest and then merging them. Left a few suggestions. Nice work, @ajantha-bhat!

core/src/main/java/org/apache/iceberg/BaseScan.java Outdated Show resolved Hide resolved
core/src/main/java/org/apache/iceberg/PartitionStats.java Outdated Show resolved Hide resolved
core/src/main/java/org/apache/iceberg/PartitionStats.java Outdated Show resolved Hide resolved
core/src/main/java/org/apache/iceberg/PartitionStats.java Outdated Show resolved Hide resolved
@ajantha-bhat ajantha-bhat force-pushed the compute_stats_no_lock branch 2 times, most recently from 5c2cf66 to 9ee176b Compare September 23, 2024 18:47
Copy link
Contributor

@aokolnychyi aokolnychyi left a comment

Choose a reason for hiding this comment

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

Almost there!

Copy link
Contributor

@aokolnychyi aokolnychyi left a comment

Choose a reason for hiding this comment

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

LGTM, final minor/cosmetic comments.

@ajantha-bhat
Copy link
Member Author

@aokolnychyi: Thanks for the review and guidance.
I have addressed the final nits.

@aokolnychyi aokolnychyi merged commit 7bd13a3 into apache:main Sep 26, 2024
49 checks passed
@aokolnychyi
Copy link
Contributor

Thanks for the hard work, @ajantha-bhat! Great to have this in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants