Package org.apache.calcite.rel.metadata
Interface BuiltInMetadata.UniqueKeys
- All Superinterfaces:
Metadata
- Enclosing class:
BuiltInMetadata
Metadata about which combinations of columns are unique identifiers.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Handler API. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Set<ImmutableBitSet>
getUniqueKeys
(boolean ignoreNulls) Determines the set of unique minimal keys for this expression.
-
Field Details
-
DEF
-
-
Method Details
-
getUniqueKeys
Determines the set of unique minimal keys for this expression. A key is represented as anImmutableBitSet
, where each bit position represents a 0-based output column ordinal.Note that a unique key plus other columns is still unique. Therefore, all columns are unique in a table with a unique key consisting of the empty set, as is the case for zero-row and single-row tables. The converse is not true: a table with all columns unique does necessary have the empty set as a key - that is never true with multi-row tables.
Nulls can be ignored if the relational expression has filtered out null values.
- Parameters:
ignoreNulls
- if true, ignore null values when determining whether the keys are unique- Returns:
- set of keys, or null if this information cannot be determined (whereas empty set indicates definitely no keys at all, and a set containing the empty set implies every column is unique)
-