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


   My guess is that the truncation width constraint was added to potentially 
catch the case where somebody has set a column's metrics to `truncation[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).
   
   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