NobiGo commented on code in PR #4402:
URL: https://github.com/apache/calcite/pull/4402#discussion_r2135496517
##########
core/src/main/java/org/apache/calcite/sql/SqlOperator.java:
##########
@@ -1036,6 +1036,19 @@ public <R> void acceptCall(
return null;
}
+ /**
+ * Returns whether this is a safe operator that doesn't throw any exception.
+ *
+ * <p> If an operator is a safe operator, we will check its parameters to
determine
+ * if the entire expression is safe.
+ *
+ * <p>For example, {@code 1/0 + null} is not safe. Because even though the
+ * {@code SqlStdOperatorTable.PLUS} is safe operator but its operands is not
safe.
+ */
+ public Boolean isSafeOperator() {
Review Comment:
How about this comment:
```
/**
* Returns whether this is a safe operator that doesn't throw any
exception.
*
* <p> If an operator is safe, then the safety of the entire expression
* will depend on its parameters.
*
* <p>For example, the expression {@code 1/0 + null} is not safe. Because
even though the
* {@code SqlStdOperatorTable.PLUS} is safe operator but its parameters is
not safe.
*
* <p>By default, returns {@code false}, which means the operator is not
safe.
*
* <p>If an expression is safe, then some optimizations can be performed in
* {@code org.apache.calcite.rex.RexSimplify}.
*
* <p>For example:
* {@code NULL + a} can be optimized to {@code NULL}.
*
*/
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]