gortiz commented on PR #11478:
URL: https://github.com/apache/pinot/pull/11478#issuecomment-1704836471

   TBH I think we are treating this as an issue when it actually isn't. It is 
normal on databases to use IEEE 754 and just advice about that. For example:
   - 
https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT
   - https://dev.mysql.com/doc/refman/8.0/en/problems-with-float.html
   - https://www.crunchydata.com/blog/choosing-a-postgresql-number-format
   - 
https://stackoverflow.com/questions/916081/convert-float-to-double-without-losing-precision
 (this explains why it feels better to transform to string first, but we could 
do the same without creating the String. See the 3rd point below)
   
   In my opinion we should:
   1. Support DECIMAL type (in case we don't already do it) for cases where 
precision is more important than performance
   2. Document that floats and doubles are in fact floating point numbers and 
therefore their precision is not guaranteed
   3. Offer some casting operation that can be customized (something like: cast 
this float to double rounding to the 3rd decimal)


-- 
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: commits-unsubscr...@pinot.apache.org

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


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

Reply via email to