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

Closed
wants to merge 1 commit into 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

@RussellSpitzer
Copy link
Member

I think based on the description it may make more sense to focus on adding config for just setting the default for variable length types to counts only?

@KartikKapur
Copy link
Author

@RussellSpitzer Thanks for the response! Do you mean being able identify these binary/string and then not applying bounds to them?

@RussellSpitzer
Copy link
Member

Yeah maybe a property like

write.metadata.metrics.variablelengthtype.default

That probably needs a better name

Essentially have a hierarchy

write.metadata.metrics.default < write.metadata.metrics.variablelengthtype.default < write.metadata.metric.specificColumn

Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 16, 2025
Copy link

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Feb 23, 2025
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.

2 participants