hsyuan commented on a change in pull request #1557: [CALCITE-3473] Getting 
unique result for table scan should contain key column(s)
URL: https://github.com/apache/calcite/pull/1557#discussion_r352714299
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/metadata/RelMdUniqueKeys.java
 ##########
 @@ -226,6 +227,18 @@ private RelMdUniqueKeys() {}
     return ImmutableSet.of();
   }
 
+  public Set<ImmutableBitSet> getUniqueKeys(TableScan rel, RelMetadataQuery mq,
+      boolean ignoreNulls) {
+    final List<ImmutableBitSet> keys = rel.getTable().getKeys();
+    if (keys.isEmpty()) {
+      return null;
+    }
+    for (ImmutableBitSet key : keys) {
+      assert rel.getTable().isKey(key);
+    }
 
 Review comment:
   Do we really need L236~238? 

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


With regards,
Apache Git Services

Reply via email to