public class TypeInferenceUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static TypeProtos.MajorType |
UNKNOWN_TYPE |
| Modifier and Type | Method and Description |
|---|---|
static FunctionCall |
convertSqlOperatorBindingToFunctionCall(org.apache.calcite.sql.SqlOperatorBinding opBinding)
Given a SqlOperatorBinding, convert it to FunctionCall
|
static org.apache.calcite.rel.type.RelDataType |
createCalciteTypeWithNullability(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory,
org.apache.calcite.sql.type.SqlTypeName sqlTypeName,
boolean isNullable)
Given a
SqlTypeName and nullability, create a RelDataType from the RelDataTypeFactory |
static org.apache.calcite.sql.type.SqlTypeName |
getCalciteTypeFromDrillType(TypeProtos.MinorType type)
Given a Drill's TypeProtos.MinorType, return a Calcite's corresponding SqlTypeName
|
static org.apache.calcite.sql.type.SqlReturnTypeInference |
getDrillSqlReturnTypeInference(String name,
List<DrillFuncHolder> functions)
Give the name and DrillFuncHolder list, return the inference mechanism.
|
static TypeProtos.MinorType |
getDrillTypeFromCalciteType(org.apache.calcite.rel.type.RelDataType relDataType)
Given a Calcite's RelDataType, return a Drill's corresponding TypeProtos.MinorType
|
static TypeProtos.MinorType |
getDrillTypeFromCalciteType(org.apache.calcite.sql.type.SqlTypeName sqlTypeName)
Given a Calcite's SqlTypeName, return a Drill's corresponding TypeProtos.MinorType
|
static org.apache.calcite.sql.type.SqlTypeName |
getSqlTypeNameForTimeUnit(String timeUnit)
For Extract and date_part functions, infer the return types based on timeUnit
|
static boolean |
isScalarStringType(org.apache.calcite.sql.type.SqlTypeName sqlTypeName)
Checks if given type is string scalar type.
|
public static final TypeProtos.MajorType UNKNOWN_TYPE
public static org.apache.calcite.sql.type.SqlTypeName getCalciteTypeFromDrillType(TypeProtos.MinorType type)
public static TypeProtos.MinorType getDrillTypeFromCalciteType(org.apache.calcite.rel.type.RelDataType relDataType)
public static TypeProtos.MinorType getDrillTypeFromCalciteType(org.apache.calcite.sql.type.SqlTypeName sqlTypeName)
public static org.apache.calcite.sql.type.SqlReturnTypeInference getDrillSqlReturnTypeInference(String name, List<DrillFuncHolder> functions)
public static boolean isScalarStringType(org.apache.calcite.sql.type.SqlTypeName sqlTypeName)
sqlTypeName - Calcite's sql type namepublic static org.apache.calcite.sql.type.SqlTypeName getSqlTypeNameForTimeUnit(String timeUnit)
public static org.apache.calcite.rel.type.RelDataType createCalciteTypeWithNullability(org.apache.calcite.rel.type.RelDataTypeFactory typeFactory,
org.apache.calcite.sql.type.SqlTypeName sqlTypeName,
boolean isNullable)
SqlTypeName and nullability, create a RelDataType from the RelDataTypeFactorytypeFactory - RelDataTypeFactory used to create the RelDataTypesqlTypeName - the given SqlTypeNameisNullable - the nullability of the created RelDataTypepublic static FunctionCall convertSqlOperatorBindingToFunctionCall(org.apache.calcite.sql.SqlOperatorBinding opBinding)
opBinding - the given SqlOperatorBindingCopyright © 2017 The Apache Software Foundation. All rights reserved.