Class UpsertKeyUtil
java.lang.Object
org.apache.flink.table.planner.plan.utils.UpsertKeyUtil
Utility for upsertKey which represented as a Set of
ImmutableBitSet.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]getSmallestKey(Set<org.apache.calcite.util.ImmutableBitSet> upsertKeys) Returns the smallest key of given upsert keys.static Optional<int[]>smallestKey(Set<org.apache.calcite.util.ImmutableBitSet> upsertKeys) Returns the smallest key of given upsert keys wrapped with a javaOptional.
-
Constructor Details
-
UpsertKeyUtil
public UpsertKeyUtil()
-
-
Method Details
-
getSmallestKey
@Nonnull public static int[] getSmallestKey(@Nullable Set<org.apache.calcite.util.ImmutableBitSet> upsertKeys) Returns the smallest key of given upsert keys. The rule of 'small' is an upsert key represented byImmutableBitSethas smaller cardinality or has a smaller leading element when the same cardinality. E.g., '{0,1}' is smaller than '{0,1,2}' and '{0,1}' is smaller than '{0,2}'.- Parameters:
upsertKeys- input upsert keys- Returns:
- the smallest key
-
smallestKey
public static Optional<int[]> smallestKey(@Nullable Set<org.apache.calcite.util.ImmutableBitSet> upsertKeys) Returns the smallest key of given upsert keys wrapped with a javaOptional. Different fromgetSmallestKey(Set), it'll return result with an emptyOptionalif the input set is null or empty.
-