Package org.apache.calcite.rel.metadata
Interface BuiltInMetadata.ColumnUniqueness
- All Superinterfaces:
Metadata
- Enclosing class:
BuiltInMetadata
Metadata about whether a set of columns uniquely identifies a row.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Handler API. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionareColumnsUnique
(ImmutableBitSet columns, boolean ignoreNulls) Determines whether a specified set of columns from a specified relational expression are unique.
-
Field Details
-
DEF
-
-
Method Details
-
areColumnsUnique
Determines whether a specified set of columns from a specified relational expression are unique.For example, if the relational expression is a
TableScan
to T(A, B, C, D) whose key is (A, B), then:areColumnsUnique([0, 1])
yields true,areColumnsUnique([0])
yields false,areColumnsUnique([0, 2])
yields false.
Nulls can be ignored if the relational expression has filtered out null values.
- Parameters:
columns
- column mask representing the subset of columns for which uniqueness will be determinedignoreNulls
- if true, ignore null values when determining column uniqueness- Returns:
- whether the columns are unique, or null if not enough information is available to make that determination
-