Class CalciteUtils
java.lang.Object
org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils
Utility methods for Calcite related operations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A LogicalType corresponding to TIME_WITH_LOCAL_TIME_ZONE. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
static final Schema.FieldType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isDateTimeType
(Schema.FieldType fieldType) Returns true if the type is any of the various date time types.static boolean
isStringType
(Schema.FieldType fieldType) static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType
sqlTypeWithAutoCast
(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, Type type) SQL-Java type mapping, with specified Beam rules:
1.static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType
toCalciteRowType
(Schema schema, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory) Create an instance ofRelDataType
so it can be used to create a table.static Schema.Field
toField
(String name, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType calciteType) static Schema.Field
toField
(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeField calciteField) static Schema.FieldType
toFieldType
(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType calciteType) static Schema.FieldType
toFieldType
(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlTypeNameSpec sqlTypeName) static Schema.FieldType
toFieldType
(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName sqlTypeName) static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType
toRelDataType
(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory, Schema.FieldType fieldType) static Schema
toSchema
(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType tableInfo) GenerateSchema
fromRelDataType
which is used to create table.static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName
-
Field Details
-
TINY_INT
-
SMALL_INT
-
INTEGER
-
BIG_INT
-
FLOAT
-
DOUBLE
-
DECIMAL
-
BOOLEAN
-
VARBINARY
-
VARCHAR
-
CHAR
-
DATE
-
NULLABLE_DATE
-
TIME
-
NULLABLE_TIME
-
TIME_WITH_LOCAL_TZ
-
TIMESTAMP
-
NULLABLE_TIMESTAMP
-
TIMESTAMP_WITH_LOCAL_TZ
-
NULLABLE_TIMESTAMP_WITH_LOCAL_TZ
-
-
Constructor Details
-
CalciteUtils
public CalciteUtils()
-
-
Method Details
-
isDateTimeType
Returns true if the type is any of the various date time types. -
isStringType
-
toSchema
public static Schema toSchema(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType tableInfo) GenerateSchema
fromRelDataType
which is used to create table. -
toSqlTypeName
public static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName toSqlTypeName(Schema.FieldType type) -
toFieldType
public static Schema.FieldType toFieldType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.SqlTypeNameSpec sqlTypeName) -
toFieldType
public static Schema.FieldType toFieldType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName sqlTypeName) -
toField
public static Schema.Field toField(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeField calciteField) -
toField
public static Schema.Field toField(String name, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType calciteType) -
toFieldType
public static Schema.FieldType toFieldType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType calciteType) -
toCalciteRowType
public static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType toCalciteRowType(Schema schema, org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory) Create an instance ofRelDataType
so it can be used to create a table. -
toRelDataType
public static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType toRelDataType(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory, Schema.FieldType fieldType) -
sqlTypeWithAutoCast
public static org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataType sqlTypeWithAutoCast(org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, Type type) SQL-Java type mapping, with specified Beam rules:
1. redirectAbstractInstant
toDate
so Calcite can recognize it.
2. For a list, the component type is needed to create a Sql array type.
3. For a Map, the component type is needed to create a Sql map type.- Parameters:
type
-- Returns:
- Calcite RelDataType
-