xiedeyantu commented on code in PR #4566:
URL: https://github.com/apache/calcite/pull/4566#discussion_r2412823889


##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdFunctionalDependency.java:
##########
@@ -64,212 +78,395 @@ protected RelMdFunctionalDependency() {}
     return BuiltInMetadata.FunctionalDependency.DEF;
   }
 
+  /**
+   * Determines whether the specified column is functionally dependent on the 
given key.
+   *
+   * @param rel Relational node
+   * @param mq Metadata query
+   * @param determinant Determinant column ordinal
+   * @param dependent Dependent column ordinal
+   * @return true if column is functionally dependent on key, false otherwise
+   */
   public @Nullable Boolean determines(RelNode rel, RelMetadataQuery mq,
-      int key, int column) {
-    return determinesImpl2(rel, mq, key, column);
+      int determinant, int dependent) {
+    return determinesSet(rel, mq, ImmutableBitSet.of(determinant), 
ImmutableBitSet.of(dependent));
+  }
+
+  /**
+   * Determines whether a set of columns functionally determines another set 
of columns.
+   *
+   * @param rel Relational node
+   * @param mq Metadata query
+   * @param determinants Determinant column set
+   * @param dependents Dependent column set
+   * @return true if dependents are functionally determined by determinants, 
false otherwise
+   */
+  public Boolean determinesSet(RelNode rel, RelMetadataQuery mq,
+      ImmutableBitSet determinants, ImmutableBitSet dependents) {
+    ArrowSet fdSet = getFDs(rel, mq);

Review Comment:
   @julianhyde I've created a new JIRA ticket 
[CALCITE-7219](https://issues.apache.org/jira/browse/CALCITE-7219) for this.



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

Reply via email to