danny0405 commented on a change in pull request #706: [CALCITE-2302] Implicit
type cast support
URL: https://github.com/apache/calcite/pull/706#discussion_r317439450
##########
File path:
core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystem.java
##########
@@ -132,11 +132,19 @@ RelDataType deriveCovarType(RelDataTypeFactory
typeFactory,
* @return the result type for a decimal addition.
*/
default RelDataType deriveDecimalPlusType(RelDataTypeFactory typeFactory,
- RelDataType type1, RelDataType
type2) {
+ RelDataType type1, RelDataType type2) {
if (SqlTypeUtil.isExactNumeric(type1)
&& SqlTypeUtil.isExactNumeric(type2)) {
if (SqlTypeUtil.isDecimal(type1)
|| SqlTypeUtil.isDecimal(type2)) {
+ // Java numeric will always have invalid precision/scale,
+ // use its default decimal precision/scale instead.
+ type1 = RelDataTypeFactoryImpl.isJavaType(type1)
Review comment:
Sure, let me add them in, i believe this patch would be merged soon.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services