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 classA LogicalType corresponding to TIME_WITH_LOCAL_TIME_ZONE. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldTypestatic final Schema.FieldType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisDateTimeType(Schema.FieldType fieldType) Returns true if the type is any of the various date time types.static booleanisStringType(Schema.FieldType fieldType) static org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypesqlTypeWithAutoCast(org.apache.beam.vendor.calcite.v1_40_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_40_0.org.apache.calcite.rel.type.RelDataTypetoCalciteRowType(Schema schema, org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory) Create an instance ofRelDataTypeso it can be used to create a table.static Schema.FieldtoField(String name, org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType calciteType) static Schema.FieldtoField(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypeField calciteField) static Schema.FieldTypetoFieldType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType calciteType) static Schema.FieldTypetoFieldType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.sql.SqlTypeNameSpec sqlTypeName) static Schema.FieldTypetoFieldType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.sql.type.SqlTypeName sqlTypeName) static org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypetoRelDataType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory, Schema.FieldType fieldType) static SchematoSchema(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType tableInfo) GenerateSchemafromRelDataTypewhich is used to create table.static org.apache.beam.vendor.calcite.v1_40_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_40_0.org.apache.calcite.rel.type.RelDataType tableInfo) GenerateSchemafromRelDataTypewhich is used to create table. -
toSqlTypeName
public static org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.sql.type.SqlTypeName toSqlTypeName(Schema.FieldType type) -
toFieldType
public static Schema.FieldType toFieldType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.sql.SqlTypeNameSpec sqlTypeName) -
toFieldType
public static Schema.FieldType toFieldType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.sql.type.SqlTypeName sqlTypeName) -
toField
public static Schema.Field toField(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypeField calciteField) -
toField
public static Schema.Field toField(String name, org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType calciteType) -
toFieldType
public static Schema.FieldType toFieldType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType calciteType) -
toCalciteRowType
public static org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType toCalciteRowType(Schema schema, org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory) Create an instance ofRelDataTypeso it can be used to create a table. -
toRelDataType
public static org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType toRelDataType(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypeFactory dataTypeFactory, Schema.FieldType fieldType) -
sqlTypeWithAutoCast
public static org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataType sqlTypeWithAutoCast(org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.rel.type.RelDataTypeFactory typeFactory, Type type) SQL-Java type mapping, with specified Beam rules:
1. redirectAbstractInstanttoDateso 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
-