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

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

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.

*/
package org.apache.iceberg;

public class PartitionStats implements StructLike {
Copy link
Member Author

Choose a reason for hiding this comment

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

Extends with StructLike as the writers will be writing these objects or wrap this object.

@@ -100,6 +101,25 @@ public static StructLike coercePartition(
return projection;
}

public static PartitionData coercePartitionData(
Copy link
Member Author

Choose a reason for hiding this comment

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

Just extracted common codes to util instead of duplicating the same.

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.

1 participant