Package net.hydromatic.morel.foreign
Class CalciteForeignValue
- java.lang.Object
-
- net.hydromatic.morel.foreign.CalciteForeignValue
-
- All Implemented Interfaces:
ForeignValue
public class CalciteForeignValue extends java.lang.Object implements ForeignValue
Value based on a Calcite schema.In ML, it appears as a record with a field for each table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCalciteForeignValue.ConverterConverts from a Calcite row to an SML record.private static classCalciteForeignValue.EmptyDataContextData context that has no variables.private static classCalciteForeignValue.FieldConverterConverts a field from Calcite to SML format.
-
Field Summary
Fields Modifier and Type Field Description private booleanlowerprivate org.apache.calcite.tools.RelBuilderrelBuilderprivate org.apache.calcite.schema.SchemaPlusschema
-
Constructor Summary
Constructors Constructor Description CalciteForeignValue(org.apache.calcite.schema.SchemaPlus schema, boolean lower)Creates a CalciteForeignValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Stringconvert(java.lang.String name)private static <E> java.util.List<E>plus(java.util.List<E> list, E e)Returns a copy of a list with one element appended.private static org.apache.calcite.schema.SchemaPlusrootSchema(org.apache.calcite.schema.SchemaPlus schema)private CalciteForeignValue.FieldConvertertoType(org.apache.calcite.rel.type.RelDataTypeField field)private TypetoType(org.apache.calcite.schema.Table table, TypeSystem typeSystem)Typetype(TypeSystem typeSystem)java.lang.Objectvalue()
-
-
-
Method Detail
-
rootSchema
private static org.apache.calcite.schema.SchemaPlus rootSchema(org.apache.calcite.schema.SchemaPlus schema)
-
type
public Type type(TypeSystem typeSystem)
- Specified by:
typein interfaceForeignValue
-
toType
private Type toType(org.apache.calcite.schema.Table table, TypeSystem typeSystem)
-
convert
private java.lang.String convert(java.lang.String name)
-
toType
private CalciteForeignValue.FieldConverter toType(org.apache.calcite.rel.type.RelDataTypeField field)
-
value
public java.lang.Object value()
- Specified by:
valuein interfaceForeignValue
-
plus
private static <E> java.util.List<E> plus(java.util.List<E> list, E e)Returns a copy of a list with one element appended.
-
-