PaulJackson123 commented on code in PR #3495:
URL: https://github.com/apache/calcite/pull/3495#discussion_r1408236861
##########
core/src/main/java/org/apache/calcite/rel/metadata/BuiltInMetadata.java:
##########
@@ -83,9 +83,9 @@ public interface UniqueKeys extends Metadata {
* represented as an {@link org.apache.calcite.util.ImmutableBitSet}, where
* each bit position represents a 0-based output column ordinal.
*
- * <p>Note that a key plus other columns is still unique. Therefore a table
- * with all columns unique has a unique key consisting of the empty set.
- * This is the case with all single-row tables.
+ * <p>Note that a unique key plus other columns is still unique.
+ * Conversely, all columns are unique in a table with a unique key
+ * consisting of the empty set, as is the case for all single-row tables.
Review Comment:
No, this is good. I see your point now. In retrospect, your zero-column
argument should have been sufficient. My confusion went like this:
1. If (A) is a unique key, (A,B) is also a unique key
2. A 0-or-1-row table has () as a unique key
3. All columns in a table with () as a key are unique
4. A table with all columns unique has () as a key
I didn't catch the leap between 3 and 4. I've been quietly unsettled about
empty keys and this clarification helps with that.
--
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]