godfreyhe commented on a change in pull request #17962:
URL: https://github.com/apache/flink/pull/17962#discussion_r759193622



##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdColumnUniqueness.scala
##########
@@ -81,9 +80,22 @@ class FlinkRelMdColumnUniqueness private extends 
MetadataHandler[BuiltInMetadata
       return false
     }
 
-    // TODO get uniqueKeys from TableSchema of TableSource
-
     relOptTable match {
+      case sourceTable: TableSourceTable =>

Review comment:
       from your change, I have another idea: we can get the unique keys first 
in a unified way via `mq.getUniqueKeys(rel)` and then check whether the given 
columns are unique. WDYT ?




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to