kbendick edited a comment on pull request #2081:
URL: https://github.com/apache/iceberg/pull/2081#issuecomment-760639623


   I'm going to open a PR that adds a check for length 0 when configuring the 
metrics mode to be Truncate. That's likely why this was originally not allowed 
to be zero (to disallow having a column with metrics `truncate[0]`). However, 
this isn't the best place for that constraint and as evidenced by the original 
issue, it's having unintended effects when there are empty string elements in 
the table that wind up being evaluated (e.g. they have stats that get 
evaluated, etc).
   
   EDIT - There already is a precondition check for disallowing a truncation 
`length == 0` to be defined for the metrics config, as well as a test for it.
   Code that disallows a zero length for configuring truncation for a columns 
metrics - 
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/MetricsModes.java#L105-L108
   Test that shows that trying to set a truncation length of zero for a columns 
metrics will throw - 
https://github.com/apache/iceberg/blob/master/core/src/test/java/org/apache/iceberg/TestMetricsModes.java#L50-L55


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to