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] Support Truncate(0) for metrics #11905

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

Conversation

KartikKapur
Copy link

Background
At Pinterest, we've started utilizing iceberg metrics considerably for offline validation as well as query speedups. Counts are consistently useful for all columns and upper/lowerbound is useful for numeric columns.; however, for struct columns (typically objects with encoded strings), ranges are relatively useless and just cause space overhead with potential driver OOM. There isn't an easy way to specify metrics per data type so wanted to contribute a solution which allows to specify truncate limit as 0 which just causes strings and binaries to be fully truncated.

Changes
Updated checks in Truncate MetricsMode to allow for non-negative rather than strictly positive length. Updated appropriate checks in order to only input into bounds map if non null

Tests

Added appropriate unit tests

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

Successfully merging this pull request may close these issues.

1 participant