aokolnychyi commented on code in PR #4947:
URL: https://github.com/apache/iceberg/pull/4947#discussion_r889283508
##########
api/src/main/java/org/apache/iceberg/expressions/Expression.java:
##########
@@ -124,4 +124,21 @@ public Operation flipLR() {
default Expression negate() {
throw new UnsupportedOperationException(String.format("%s cannot be
negated", this));
}
+
+ /**
+ * Returns whether this expression will accept the same values as another.
+ * <p>
+ * If this returns true, the expressions are guaranteed to return the same
evaluation for the same input. However, if
+ * this returns false the expressions may return the same evaluation for the
same input. That is, expressions may
+ * be equivalent even if this returns false.
+ * <p>
+ * For best results, rewrite not and bind expressions before calling this
method.
+ *
+ * @param other another expression
+ * @return true if the expressions are equivalent
+ */
+ default boolean isEquivalentTo(Expression other) {
Review Comment:
In which cases we use `is` prefix for boolean methods and in which no?
We are not very consistent in the code right now.
##########
api/src/main/java/org/apache/iceberg/expressions/Expression.java:
##########
@@ -124,4 +124,21 @@ public Operation flipLR() {
default Expression negate() {
throw new UnsupportedOperationException(String.format("%s cannot be
negated", this));
}
+
+ /**
+ * Returns whether this expression will accept the same values as another.
+ * <p>
+ * If this returns true, the expressions are guaranteed to return the same
evaluation for the same input. However, if
+ * this returns false the expressions may return the same evaluation for the
same input. That is, expressions may
+ * be equivalent even if this returns false.
+ * <p>
+ * For best results, rewrite not and bind expressions before calling this
method.
+ *
+ * @param other another expression
+ * @return true if the expressions are equivalent
+ */
+ default boolean isEquivalentTo(Expression other) {
Review Comment:
In which cases we use `is` prefix for boolean methods and in which no?
We are not very consistent in the code right now.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]