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 2020/07/02 11:55:41 UTC

[GitHub] [calcite] rubenada commented on a change in pull request #2049: [CALCITE-4094] Allow SqlOperator of SqlKind#OTHER_FUNCTION to define a Strong.Policy

rubenada commented on a change in pull request #2049:
URL: https://github.com/apache/calcite/pull/2049#discussion_r448947467



##########
File path: core/src/main/java/org/apache/calcite/plan/Strong.java
##########
@@ -85,8 +86,32 @@ public static boolean isNotTrue(RexNode node, ImmutableBitSet nullColumns) {
   }
 
   /** Returns how to deduce whether a particular kind of expression is null,
-   * given whether its arguments are null. */
+   * given whether its arguments are null.
+   * @deprecated Use {@link Strong#policy(RexNode)} or {@link Strong#policy(SqlOperator)} */
+  @Deprecated // to be removed before 2.0
   public static Policy policy(SqlKind kind) {
+    return getPolicy(kind);

Review comment:
       Currently, `Strong#policy` method works at `SqlKind` level, and this `SqlKind` can come from a `RexNode`, or from a `SqlOperator`. As discussed, the problem with the current approach is that `SqlKind` is not enough for `SqlKind.OTHER_FUNCTION` cases, for that reason I was thinking in replacing `policy(SqlKind kind)`  (first deprecate, eventually remove it) with the alternatives `policy(RexNode rexNode)` and `policy(SqlOperator operator)`, which allows us to maintain the previous behavoir, plus be able to get some extra checks for `SqlKind.OTHER_FUNCTION` cases and return the other function's operator's Policy (if defined) 




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