Class CastRulePredicate
java.lang.Object
org.apache.flink.table.planner.functions.casting.CastRulePredicate
In order to apply a
CastRule, the runtime checks if a particular rule matches the tuple
of input and target type using this class. In particular, a rule is applied if:
getTargetTypeRoots()includes theLogicalTypeRootof target type and eithergetInputTypeRoots()includes theLogicalTypeRootof input type orgetInputTypeFamilies()includes one of theLogicalTypeFamilyof input type
- Or
getTargetTypeFamilies()includes one of theLogicalTypeFamilyof target type and eithergetInputTypeRoots()includes theLogicalTypeRootof input type orgetInputTypeFamilies()includes one of theLogicalTypeFamilyof input type
- Or, if
getCustomPredicate()is not null, the inputLogicalTypeand targetLogicalTypematches the predicate.
The customPredicate should be used in cases where LogicalTypeRoot and LogicalTypeFamily are not enough to identify whether a rule is applicable or not, for example
when the matching depends on a field of the provided input LogicalType instance.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CastRulePredicate.Builderbuilder()Optional<BiPredicate<org.apache.flink.table.types.logical.LogicalType,org.apache.flink.table.types.logical.LogicalType>> Set<org.apache.flink.table.types.logical.LogicalTypeFamily>Set<org.apache.flink.table.types.logical.LogicalTypeRoot>Set<org.apache.flink.table.types.logical.LogicalTypeFamily>Set<org.apache.flink.table.types.logical.LogicalTypeRoot>Set<org.apache.flink.table.types.logical.LogicalType>
-
Method Details
-
getTargetTypes
-
getInputTypeRoots
-
getTargetTypeRoots
-
getInputTypeFamilies
-
getTargetTypeFamilies
-
getCustomPredicate
public Optional<BiPredicate<org.apache.flink.table.types.logical.LogicalType,org.apache.flink.table.types.logical.LogicalType>> getCustomPredicate() -
builder
-