danny0405 commented on a change in pull request #1381: [CALCITE-3245] 
CompileException in Janino when a query contains a division between a Double 
and a BigDecimal
URL: https://github.com/apache/calcite/pull/1381#discussion_r322106087
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactoryImpl.java
 ##########
 @@ -503,7 +503,8 @@ private RelDataType decimalOf2(RelDataType type) {
     assert typeName != null;
     switch (typeName) {
     case DECIMAL:
-      return type;
+      return RelDataTypeFactoryImpl.isJavaType(type)
 
 Review comment:
   `createSqlType(SqlTypeName.DECIMAL)` returns a decimal with max precision 
and 0 as scale, like a `LONG` type, for java decimal, maybe we should return a 
max precision/scale decimal, use method 
`SqlTypeUtil#getMaxPrecisionScaleDecimal`.

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

Reply via email to