Package net.hydromatic.morel.foreign
Class Converters
java.lang.Object
net.hydromatic.morel.foreign.Converters
Utilities for Converter.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classConverter from Calcite types to Morel types.(package private) static enumConverts a field from Calcite to Morel format.private static classConverter that creates a record. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TypefieldType(org.apache.calcite.rel.type.RelDataTypeField field) fromEnumerable(org.apache.calcite.rel.RelNode rel, Type type) ofField(org.apache.calcite.rel.type.RelDataType type, int ordinal) ofField2(Iterator<org.apache.calcite.rel.type.RelDataTypeField> fields, AtomicInteger ordinal, Type type) ofField3(org.apache.calcite.rel.type.RelDataTypeField field, AtomicInteger ordinal, Type type) Creates a converter that applies to theith field of the input array.ofRow(org.apache.calcite.rel.type.RelDataType rowType) ofRow2(org.apache.calcite.rel.type.RelDataType rowType, RecordLikeType type) ofRow3(Iterator<org.apache.calcite.rel.type.RelDataTypeField> fields, AtomicInteger ordinal, org.apache.calcite.linq4j.Enumerator<Type> types) Returns a function that converts from Morel objects to Calcite objects.toCalciteEnumerable(Type type, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) Returns a function that converts from Morel objects to an Enumerable over Calcite rows.static org.apache.calcite.rel.type.RelDataTypetoCalciteType(Type type, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) Returns a function that converts from Calcite objects to Morel objects.
-
Constructor Details
-
Converters
private Converters()
-
-
Method Details
-
ofRow
-
ofRow2
public static Converter<Object[]> ofRow2(org.apache.calcite.rel.type.RelDataType rowType, RecordLikeType type) -
ofRow3
static Converter<Object[]> ofRow3(Iterator<org.apache.calcite.rel.type.RelDataTypeField> fields, AtomicInteger ordinal, org.apache.calcite.linq4j.Enumerator<Type> types) -
ofField
-
ofField2
static Converter<Object[]> ofField2(Iterator<org.apache.calcite.rel.type.RelDataTypeField> fields, AtomicInteger ordinal, Type type) -
offset
Creates a converter that applies to theith field of the input array. -
ofField3
static Converter<Object[]> ofField3(org.apache.calcite.rel.type.RelDataTypeField field, AtomicInteger ordinal, Type type) -
fromEnumerable
-
forType
-
fieldType
-
toCalciteType
public static org.apache.calcite.rel.type.RelDataType toCalciteType(Type type, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) -
toCalciteEnumerable
public static Function<Object,org.apache.calcite.linq4j.Enumerable<Object[]>> toCalciteEnumerable(Type type, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) Returns a function that converts from Morel objects to an Enumerable over Calcite rows. -
toCalcite
public static Function<Object,Object> toCalcite(Type type, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) Returns a function that converts from Morel objects to Calcite objects. -
toMorel
public static Function<Object,Object> toMorel(Type type, org.apache.calcite.rel.type.RelDataTypeFactory typeFactory) Returns a function that converts from Calcite objects to Morel objects.
-