abhioncbr commented on PR #10814:
URL: https://github.com/apache/pinot/pull/10814#issuecomment-1573927172

   > according to `TypeCoercion` logic it should automatically hoist both 
INT-LONG and FLOAT-DOUBLE in Calcite. it is also possible the cast is there for 
null vs. non-null which also will trigger a type coercion logic.
   > 
   > I will take a look and see what's the appropriate overwrite for this one.
   
   I found that the CAST will happen based on the evaluation of this 
[function](https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystemImpl.java#L62).
 The `CAST` transformation applies to the data type with lower precision. In 
the case of INT-LONG, Integer has lower precision(10) vs BigInt(19). However, 
In the case of FLOAT-DOUBLE, both have the same precision and hence CAST 
applies to the RHS. I override the method in my latest commit by assigning 
`DOUBLE` more precision value than `FLOAT`. 


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