You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "abhioncbr (via GitHub)" <gi...@apache.org> on 2023/06/02 15:27:19 UTC

[GitHub] [pinot] abhioncbr commented on pull request #10814: [multistage][float-double-comparison]: updated for CAST function addition based on correct precision.

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-unsubscribe@pinot.apache.org

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


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