You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/07/11 14:14:40 UTC

[GitHub] [calcite] laurentgo commented on a change in pull request #1311: [CALCITE-3187] Make decimal type inference overridable

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_r302566163
 
 

 ##########
 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 default should have the same behavior as currently: if one of the operand types are decimal and both are exact numeric types, return the type of the second argument. It doesn't change existing behavior of the operand, and people who use {{RelDataTypeFactory}} can leverage the new method.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services