liurenjie1024 commented on issue #159:
URL: https://github.com/apache/iceberg-rust/issues/159#issuecomment-1886064501

   > @liurenjie1024 mentioned error messages as another use cases. That's the 
only time that the i128 representation might not be suitable. The question is 
whether the error messages warrant a more complex implementation.
   > 
   > Regarding @Fokko's example: Doesn't initially storing the Decimal as a 
LiteralFloat loose accuracy because the 3.25 is stored as something like 
3.24999999987. If you then convert it to Decimal, it's inaccurate. Maybe you 
could use PrimitiveLiteral::String here.
   
   Error message is just an example, not all use cases. For example when we 
convert unbound expression to bound expression, how do we know its original 
scale?
   
   String is enough for storing decimal, or everything, but it maybe weird in 
api, since with only a string we don't know its original type, e.g. user may 
write an unbound expression like `a < "3.23"`, where `a` is a decimal and it's 
legal to compare it with string.
   
   I do admit that introducing another enum will be difficult maintain, maybe 
the solution suggested by @ZENOTME is great:
   
   ```
   struct Datum {
     typ: PrimitiveType,
     literal: PrimitiveLiteral
   }
   ```
   


-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to