walterddr commented on PR #10814: URL: https://github.com/apache/pinot/pull/10814#issuecomment-1573950275
> I found that the CAST transformation 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 value and hence CAST applies to the RHS. I override the method in my latest commit by assigning `DOUBLE` more precision value than `FLOAT` to get the correct results. hmm. this seems incorrect. according to `RelDataTypeFactoryImpl` ``` case FLOAT: return createSqlType(SqlTypeName.DECIMAL, 14, 7); case DOUBLE: // the default max precision is 19, so this is actually DECIMAL(19, 15) // but derived system can override the max precision/scale. return createSqlType(SqlTypeName.DECIMAL, 30, 15); ``` I think there are some discrepancy when we overwrite TypeSystem vs TypeFactory -- 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