Enum JavaRowFormat
- java.lang.Object
-
- java.lang.Enum<JavaRowFormat>
-
- org.apache.calcite.adapter.enumerable.JavaRowFormat
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<JavaRowFormat>
public enum JavaRowFormat extends java.lang.Enum<JavaRowFormat>
How a row is represented as a Java value.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
JavaRowFormat()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Expression
comparer()
abstract Expression
field(Expression expression, int field, java.lang.reflect.Type fromType, java.lang.reflect.Type fieldType)
Returns a reference to a particular field.(package private) abstract java.lang.reflect.Type
javaFieldClass(JavaTypeFactory typeFactory, RelDataType type, int index)
Returns the java class that is used to physically store the given field.(package private) abstract java.lang.reflect.Type
javaRowClass(JavaTypeFactory typeFactory, RelDataType type)
JavaRowFormat
optimize(RelDataType rowType)
abstract Expression
record(java.lang.reflect.Type javaRowClass, java.util.List<Expression> expressions)
static JavaRowFormat
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static JavaRowFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CUSTOM
public static final JavaRowFormat CUSTOM
-
SCALAR
public static final JavaRowFormat SCALAR
-
LIST
public static final JavaRowFormat LIST
A list that is comparable and immutable. Useful for records with 0 fields (empty list is a good singleton) but sometimes also for records with 2 or more fields that you need to be comparable, say as a key in a lookup.
-
ROW
public static final JavaRowFormat ROW
SeeRow
-
ARRAY
public static final JavaRowFormat ARRAY
-
-
Method Detail
-
values
public static JavaRowFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JavaRowFormat c : JavaRowFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JavaRowFormat valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
optimize
public JavaRowFormat optimize(RelDataType rowType)
-
javaRowClass
abstract java.lang.reflect.Type javaRowClass(JavaTypeFactory typeFactory, RelDataType type)
-
javaFieldClass
abstract java.lang.reflect.Type javaFieldClass(JavaTypeFactory typeFactory, RelDataType type, int index)
Returns the java class that is used to physically store the given field. For instance, a non-null int field can still be stored in a field of typeObject.class
inARRAY
case.- Parameters:
typeFactory
- type factory to resolve java typestype
- row typeindex
- field index- Returns:
- java type used to store the field
-
record
public abstract Expression record(java.lang.reflect.Type javaRowClass, java.util.List<Expression> expressions)
-
comparer
public Expression comparer()
-
field
public abstract Expression field(Expression expression, int field, java.lang.reflect.Type fromType, java.lang.reflect.Type fieldType)
Returns a reference to a particular field.fromType
may be null; if null, uses the natural type of the field.
-
-