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


##########
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:
   Thanks for @mihaibudiu and @julianhyde, I will file a Jira later. 
@julianhyde Please help take a look and see if there are any other issues with 
this PR.



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