laurentgo commented on a change in pull request #1311: CALCITE-3187: Make 
decimal type inference overridable.
URL: https://github.com/apache/calcite/pull/1311#discussion_r301869697
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/type/RelDataTypeFactory.java
 ##########
 @@ -308,6 +308,29 @@ RelDataType createDecimalQuotient(
   @SuppressWarnings("deprecation")
   FieldInfoBuilder builder();
 
+  /**
+   * Infers the return type of a decimal addition. Decimal addition involves
+   * at least one decimal operand and requires both operands to have exact
+   * numeric types.
+   *
+   * @param type1 type of the first operand
+   * @param type2 type of the second operand
+   * @return the result type for a decimal addition, or null if decimal
+   * addition should not be applied to the operands.
+   */
+  RelDataType createDecimalAddition(RelDataType type1, RelDataType type2);
+
+  /**
+   * Infers the return type of a decimal mod operation. Currently only a hook 
point
 
 Review comment:
   The comment about hook point is unnecessary since this is an interface and 
there's no implementation. Similar to `createDecimalAddition`, should one of 
the operand be a decimal and the second one be an exact numeric type?
   
   One could (should?) add a default implementation too: the expectation is 
that it should return something non-null if operands are valid as it might be 
used in a different context.

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