Modifier and Type | Method and Description |
---|---|
static Object |
toFlinkInternalValue(Comparable<?> value,
LogicalType valueType)
Convert a value from Calcite's
Comparable data structures to Flink internal data
structures and also tries to be a bit flexible by accepting usual Java types such as String
and boxed numerics. |
static Tuple2<Object,LogicalType> |
toFlinkInternalValue(org.apache.calcite.rex.RexLiteral literal)
|
public static Tuple2<Object,LogicalType> toFlinkInternalValue(org.apache.calcite.rex.RexLiteral literal)
public static Object toFlinkInternalValue(Comparable<?> value, LogicalType valueType)
Comparable
data structures to Flink internal data
structures and also tries to be a bit flexible by accepting usual Java types such as String
and boxed numerics.
In case of symbol types, this function will return provided value, checking that it's an
Enum
.
This function is essentially like FlinkTypeFactory.toLogicalType(RelDataType)
but
for values.
Check RexLiteral.valueMatchesType(Comparable, SqlTypeName, boolean)
for details on
the Comparable
data structures and RowData
for
details on Flink's internal data structures.
value
- the value in Calcite's Comparable
data structuresvalueType
- the type of the valueIllegalArgumentException
- in case the class of value does not match the expectations
of valueTypeCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.