liyafan82 commented on a change in pull request #2074:
URL: https://github.com/apache/calcite/pull/2074#discussion_r457021057



##########
File path: core/src/main/java/org/apache/calcite/rel/RelNode.java
##########
@@ -335,6 +335,26 @@ default String getDigest() {
   @API(since = "1.24", status = API.Status.INTERNAL)
   void recomputeDigest();
 
+  /**
+   * Equality check for RelNode digest.
+   *
+   * <p>By default this method collects digest attributes from
+   * explain terms, then compares each attribute pair.</p>
+   *
+   * @return Whether the 2 RelNodes are equivalent or have the same digest.
+   * @see #digestHash()
+   */
+  @API(since = "1.25", status = API.Status.EXPERIMENTAL)
+  boolean digestEquals(Object obj);
+
+  /**
+   * Compute hash code for RelNode digest.
+   *
+   * @see #digestEquals(Object)
+   */
+  @API(since = "1.25", status = API.Status.EXPERIMENTAL)
+  int digestHash();

Review comment:
       I see. Thanks for your clarification.
   Do we intend to support this for other tree-like data structures (e.g. 
RexNode) ?




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


Reply via email to