mapleFU opened a new issue, #13255:
URL: https://github.com/apache/iceberg/issues/13255

   ### Query engine
   
   *
   
   ### Question
   
   I notice the code here:
   
   ```java
     static class DoubleLiteral extends ComparableLiteral<Double> {
       DoubleLiteral(Double value) {
         super(value);
       }
   
       @Override
       @SuppressWarnings("unchecked")
       public <T> Literal<T> to(Type type) {
         switch (type.typeId()) {
           case FLOAT:
             if ((double) Float.MAX_VALUE < value()) {
               return aboveMax();
             } else if ((double) -Float.MAX_VALUE > value()) {
               // Compare with -Float.MAX_VALUE because it is the most negative 
float value.
               // Float.MIN_VALUE is the smallest non-negative floating point 
value.
               return belowMin();
             }
             return (Literal<T>) new FloatLiteral(value().floatValue());
           case DOUBLE:
             return (Literal<T>) this;
           case DECIMAL:
             int scale = ((Types.DecimalType) type).scale();
             return (Literal<T>)
                 new DecimalLiteral(BigDecimal.valueOf(value()).setScale(scale, 
RoundingMode.HALF_UP));
           default:
             return null;
         }
       }
   ```
   
   Since Float can have INF -INF, it's greater than normalized float value, but 
if double is INF, it cannot above "max of  all floats?"


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