ghoshp83 commented on issue #3981:
URL: 
https://github.com/apache/iceberg-python/issues/3981#issuecomment-5702321490

   I'd like to pick this up.
   
   Before opening a PR, one question about the bound. The Java `DecimalType` 
doesn't check scale either, and the spec only bounds precision. Negative scale 
already can't get in through the string form, since `DECIMAL_REGEX` only 
matches `\d+`, so what's actually missing is the constructor path and `scale > 
precision`.
   
   I was planning to add a `check_scale` validator enforcing `0 <= scale <= 
precision`, alongside `check_precision`, with tests covering both the 
constructor and the `decimal(p, s)` string path.
   
   The one risk I see is compatibility. The validator also runs when table 
metadata is deserialized, so a table written by another engine with `scale > 
precision` would stop loading in PyIceberg. Is rejecting that on read 
acceptable, or would you rather the check only apply when a schema is created?
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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