public class ExprNodeDescExprFactory extends ExprFactory<ExprNodeDesc>
ExprNodeDesc.| Constructor and Description |
|---|
ExprNodeDescExprFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addExprToExprsList(ExprNodeDesc columnList,
ExprNodeDesc expr)
Adds expression to list of expressions (list needs to be
mutable).
|
protected TypeInfo |
adjustConstantType(PrimitiveTypeInfo targetType,
Object constantValue)
Adjust type of constant value based on input type, e.g., adjust precision and scale
of decimal value based on type information.
|
protected boolean |
convertCASEIntoCOALESCEFuncCallExpr(FunctionInfo fi,
List<ExprNodeDesc> inputs)
Returns true if a CASE expression can be converted into a COALESCE function call.
|
protected boolean |
convertCASEIntoIFFuncCallExpr(FunctionInfo fi,
List<ExprNodeDesc> inputs)
Returns true if a CASE expression can be converted into an IF function call.
|
protected ExprNodeConstantDesc |
createBigintConstantExpr(String value)
Creates a bigint constant expression from input value.
|
protected ExprNodeConstantDesc |
createBooleanConstantExpr(String value)
Creates a boolean constant expression from input value.
|
protected ExprNodeColumnDesc |
createColumnRefExpr(ColumnInfo colInfo,
List<RowResolver> rowResolverList)
Creates column expression.
|
protected ExprNodeColumnDesc |
createColumnRefExpr(ColumnInfo colInfo,
RowResolver rowResolver,
int offset)
Creates column expression.
|
protected ExprNodeConstantDesc |
createConstantExpr(TypeInfo typeInfo,
Object constantValue)
Creates a constant expression from input value with given type.
|
protected ExprNodeConstantDesc |
createDateConstantExpr(String value)
Creates a date constant expression from input value.
|
protected ExprNodeConstantDesc |
createDecimalConstantExpr(String value,
boolean allowNullValueConstantExpr)
Creates a decimal constant expression from input value.
|
protected ExprNodeConstantDesc |
createDoubleConstantExpr(String value)
Creates a double constant expression from input value.
|
protected ExprDynamicParamDesc |
createDynamicParamExpr(int index)
Creates a dynamic parameter expression with void type.
|
protected ExprNodeColumnListDesc |
createExprsListExpr()
Creates list of expressions.
|
protected ExprNodeConstantDesc |
createFloatConstantExpr(String value)
Creates a float constant expression from input value.
|
protected ExprNodeGenericFuncDesc |
createFuncCallExpr(TypeInfo typeInfo,
FunctionInfo fi,
String funcText,
List<ExprNodeDesc> inputs)
Creates function call expression.
|
protected ExprNodeConstantDesc |
createIntConstantExpr(String value)
Creates a int constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalDayConstantExpr(String value)
Creates a interval day constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalDayTimeConstantExpr(String value)
Creates a interval day-time constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalHourConstantExpr(String value)
Creates a interval hour constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalMinuteConstantExpr(String value)
Creates a interval minute constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalMonthConstantExpr(String value)
Creates a interval month constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalSecondConstantExpr(String value)
Creates a interval second constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalYearConstantExpr(String value)
Creates a interval year constant expression from input value.
|
protected ExprNodeConstantDesc |
createIntervalYearMonthConstantExpr(String value)
Creates a interval year-month constant expression from input value.
|
protected ExprNodeFieldDesc |
createNestedColumnRefExpr(TypeInfo typeInfo,
ExprNodeDesc expr,
String fieldName,
Boolean isList)
Creates a reference to a nested field.
|
protected ExprNodeConstantDesc |
createNullConstantExpr()
Creates a null constant expression with void type.
|
protected ExprNodeConstantDesc |
createSmallintConstantExpr(String value)
Creates a smallint constant expression from input value.
|
protected ExprNodeConstantDesc |
createStringConstantExpr(String value)
Creates a string constant expression from input value.
|
protected ExprNodeDesc |
createStructExpr(TypeInfo typeInfo,
List<ExprNodeDesc> operands)
Creates a struct with given type.
|
protected ExprNodeDesc |
createSubqueryExpr(TypeCheckCtx ctx,
ASTNode expr,
SubqueryType subqueryType,
Object[] inputs)
Creates subquery expression.
|
protected ExprNodeConstantDesc |
createTimestampConstantExpr(String value)
Creates a timestamp constant expression from input value.
|
protected ExprNodeConstantDesc |
createTimestampLocalTimeZoneConstantExpr(String value,
ZoneId zoneId)
Creates a timestamp with local time zone constant expression from input value.
|
protected ExprNodeConstantDesc |
createTinyintConstantExpr(String value)
Creates a tinyint constant expression from input value.
|
protected ExprNodeDesc |
foldExpr(ExprNodeDesc expr)
Folds the input expression and returns resulting expression.
|
protected String |
getColumnName(ExprNodeDesc expr,
RowResolver rowResolver)
Returns column name referenced by a column expression.
|
protected Object |
getConstantValue(ExprNodeDesc expr)
Returns value stored in a constant expression.
|
protected String |
getConstantValueAsString(ExprNodeDesc expr)
Returns value stored in a constant expression as String.
|
protected List<ExprNodeDesc> |
getExprChildren(ExprNodeDesc expr)
Returns the children from the input expression (if any).
|
protected FunctionInfo |
getFunctionInfo(String funcName)
Returns the FunctionInfo given the name
|
protected List<String> |
getStructNameList(ExprNodeDesc expr)
Returns the list of names in the input struct expression.
|
protected List<TypeInfo> |
getStructTypeInfoList(ExprNodeDesc expr)
Returns the list of types in the input struct expression.
|
protected TypeInfo |
getTypeInfo(ExprNodeDesc expr)
Returns the type for the input expression.
|
protected Object |
interpretConstantAsPrimitive(PrimitiveTypeInfo targetType,
Object constantValue,
PrimitiveTypeInfo sourceType,
boolean isEqual)
Interpret the input constant value of source type as target type.
|
protected boolean |
isANDFuncCallExpr(ExprNodeDesc expr)
Returns whether the input expression is an AND function call.
|
protected boolean |
isAndFunction(FunctionInfo fi) |
protected boolean |
isColumnRefExpr(Object o)
Returns whether the input object is a column reference expression.
|
protected boolean |
isCompareFunction(FunctionInfo fi) |
protected boolean |
isConsistentWithinQuery(FunctionInfo fi) |
protected boolean |
isConstantExpr(Object o)
Returns whether the input expression is a constant expression.
|
protected boolean |
isConstantStruct(ExprNodeDesc expr)
Returns whether the input expression is a struct of
constant expressions (all of them).
|
protected boolean |
isEqualFunction(FunctionInfo fi) |
protected boolean |
isExprInstance(Object o)
Returns whether the input is an instance of the expression class.
|
protected boolean |
isExprsListExpr(Object o)
Returns whether the input expression is a list of expressions.
|
protected boolean |
isFuncCallExpr(Object o)
Returns whether the input expression is a function call.
|
protected boolean |
isInFunction(FunctionInfo fi) |
protected boolean |
isNEGATIVEFuncCallExpr(ExprNodeDesc expr)
Returns whether the input expression is a NEGATIVE function call.
|
protected boolean |
isNSCompareFunction(FunctionInfo fi) |
protected boolean |
isORFuncCallExpr(ExprNodeDesc expr)
Returns whether the input expression is an OR function call.
|
protected boolean |
isOrFunction(FunctionInfo fi) |
protected boolean |
isPOSITIVEFuncCallExpr(ExprNodeDesc expr)
Returns whether the input expression is a POSITIVE function call.
|
protected boolean |
isStateful(FunctionInfo fi) |
protected boolean |
isSTRUCTFuncCallExpr(ExprNodeDesc expr)
Returns whether the input expression is a STRUCT function call.
|
protected ExprNodeDesc |
replaceFieldNamesInStruct(ExprNodeDesc expr,
List<String> newFieldNames) |
protected ExprNodeDesc |
setTypeInfo(ExprNodeDesc expr,
TypeInfo type)
Changes the type of the input expression to the input type and
returns resulting expression.
|
protected ExprNodeDesc |
toExpr(ColumnInfo colInfo,
RowResolver rowResolver,
int offset)
Generates an expression from the input column.
|
createConstantExpr, isAllConstantsprotected boolean isExprInstance(Object o)
isExprInstance in class ExprFactory<ExprNodeDesc>protected ExprNodeDesc toExpr(ColumnInfo colInfo, RowResolver rowResolver, int offset) throws SemanticException
toExpr in class ExprFactory<ExprNodeDesc>SemanticExceptionprotected ExprNodeColumnDesc createColumnRefExpr(ColumnInfo colInfo, RowResolver rowResolver, int offset)
createColumnRefExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeColumnDesc createColumnRefExpr(ColumnInfo colInfo, List<RowResolver> rowResolverList)
createColumnRefExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createNullConstantExpr()
createNullConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprDynamicParamDesc createDynamicParamExpr(int index)
createDynamicParamExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createBooleanConstantExpr(String value)
createBooleanConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createBigintConstantExpr(String value)
createBigintConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntConstantExpr(String value)
createIntConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createSmallintConstantExpr(String value)
createSmallintConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createTinyintConstantExpr(String value)
createTinyintConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createFloatConstantExpr(String value)
createFloatConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createDoubleConstantExpr(String value)
createDoubleConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createDecimalConstantExpr(String value, boolean allowNullValueConstantExpr)
createDecimalConstantExpr in class ExprFactory<ExprNodeDesc>protected TypeInfo adjustConstantType(PrimitiveTypeInfo targetType, Object constantValue)
ExprFactoryadjustConstantType in class ExprFactory<ExprNodeDesc>protected Object interpretConstantAsPrimitive(PrimitiveTypeInfo targetType, Object constantValue, PrimitiveTypeInfo sourceType, boolean isEqual)
interpretConstantAsPrimitive in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createStringConstantExpr(String value)
createStringConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createDateConstantExpr(String value)
createDateConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createTimestampConstantExpr(String value)
createTimestampConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createTimestampLocalTimeZoneConstantExpr(String value, ZoneId zoneId)
createTimestampLocalTimeZoneConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalYearMonthConstantExpr(String value)
createIntervalYearMonthConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalDayTimeConstantExpr(String value)
createIntervalDayTimeConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalYearConstantExpr(String value)
createIntervalYearConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalMonthConstantExpr(String value)
createIntervalMonthConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalDayConstantExpr(String value)
createIntervalDayConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalHourConstantExpr(String value)
createIntervalHourConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalMinuteConstantExpr(String value)
createIntervalMinuteConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeConstantDesc createIntervalSecondConstantExpr(String value)
createIntervalSecondConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeDesc createStructExpr(TypeInfo typeInfo, List<ExprNodeDesc> operands) throws SemanticException
createStructExpr in class ExprFactory<ExprNodeDesc>SemanticExceptionprotected ExprNodeConstantDesc createConstantExpr(TypeInfo typeInfo, Object constantValue)
createConstantExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeFieldDesc createNestedColumnRefExpr(TypeInfo typeInfo, ExprNodeDesc expr, String fieldName, Boolean isList)
createNestedColumnRefExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeGenericFuncDesc createFuncCallExpr(TypeInfo typeInfo, FunctionInfo fi, String funcText, List<ExprNodeDesc> inputs) throws UDFArgumentException
createFuncCallExpr in class ExprFactory<ExprNodeDesc>UDFArgumentExceptionprotected ExprNodeColumnListDesc createExprsListExpr()
createExprsListExpr in class ExprFactory<ExprNodeDesc>protected void addExprToExprsList(ExprNodeDesc columnList, ExprNodeDesc expr)
addExprToExprsList in class ExprFactory<ExprNodeDesc>protected boolean isConstantExpr(Object o)
isConstantExpr in class ExprFactory<ExprNodeDesc>protected boolean isFuncCallExpr(Object o)
isFuncCallExpr in class ExprFactory<ExprNodeDesc>protected Object getConstantValue(ExprNodeDesc expr)
getConstantValue in class ExprFactory<ExprNodeDesc>protected String getConstantValueAsString(ExprNodeDesc expr)
getConstantValueAsString in class ExprFactory<ExprNodeDesc>protected boolean isColumnRefExpr(Object o)
isColumnRefExpr in class ExprFactory<ExprNodeDesc>protected String getColumnName(ExprNodeDesc expr, RowResolver rowResolver)
getColumnName in class ExprFactory<ExprNodeDesc>protected boolean isExprsListExpr(Object o)
isExprsListExpr in class ExprFactory<ExprNodeDesc>protected List<ExprNodeDesc> getExprChildren(ExprNodeDesc expr)
getExprChildren in class ExprFactory<ExprNodeDesc>protected TypeInfo getTypeInfo(ExprNodeDesc expr)
getTypeInfo in class ExprFactory<ExprNodeDesc>protected List<TypeInfo> getStructTypeInfoList(ExprNodeDesc expr)
getStructTypeInfoList in class ExprFactory<ExprNodeDesc>protected List<String> getStructNameList(ExprNodeDesc expr)
getStructNameList in class ExprFactory<ExprNodeDesc>protected boolean isORFuncCallExpr(ExprNodeDesc expr)
isORFuncCallExpr in class ExprFactory<ExprNodeDesc>protected boolean isANDFuncCallExpr(ExprNodeDesc expr)
isANDFuncCallExpr in class ExprFactory<ExprNodeDesc>protected boolean isPOSITIVEFuncCallExpr(ExprNodeDesc expr)
isPOSITIVEFuncCallExpr in class ExprFactory<ExprNodeDesc>protected boolean isNEGATIVEFuncCallExpr(ExprNodeDesc expr)
isNEGATIVEFuncCallExpr in class ExprFactory<ExprNodeDesc>protected boolean isAndFunction(FunctionInfo fi)
isAndFunction in class ExprFactory<ExprNodeDesc>protected boolean isOrFunction(FunctionInfo fi)
isOrFunction in class ExprFactory<ExprNodeDesc>protected boolean isInFunction(FunctionInfo fi)
isInFunction in class ExprFactory<ExprNodeDesc>protected boolean isCompareFunction(FunctionInfo fi)
isCompareFunction in class ExprFactory<ExprNodeDesc>protected boolean isEqualFunction(FunctionInfo fi)
isEqualFunction in class ExprFactory<ExprNodeDesc>protected boolean isNSCompareFunction(FunctionInfo fi)
isNSCompareFunction in class ExprFactory<ExprNodeDesc>protected boolean isConsistentWithinQuery(FunctionInfo fi)
isConsistentWithinQuery in class ExprFactory<ExprNodeDesc>protected boolean isStateful(FunctionInfo fi)
isStateful in class ExprFactory<ExprNodeDesc>protected ExprNodeDesc setTypeInfo(ExprNodeDesc expr, TypeInfo type)
setTypeInfo in class ExprFactory<ExprNodeDesc>protected boolean convertCASEIntoCOALESCEFuncCallExpr(FunctionInfo fi, List<ExprNodeDesc> inputs)
convertCASEIntoCOALESCEFuncCallExpr in class ExprFactory<ExprNodeDesc>protected boolean convertCASEIntoIFFuncCallExpr(FunctionInfo fi, List<ExprNodeDesc> inputs)
ExprFactoryconvertCASEIntoIFFuncCallExpr in class ExprFactory<ExprNodeDesc>protected ExprNodeDesc foldExpr(ExprNodeDesc expr)
foldExpr in class ExprFactory<ExprNodeDesc>protected boolean isSTRUCTFuncCallExpr(ExprNodeDesc expr)
isSTRUCTFuncCallExpr in class ExprFactory<ExprNodeDesc>protected boolean isConstantStruct(ExprNodeDesc expr)
isConstantStruct in class ExprFactory<ExprNodeDesc>protected ExprNodeDesc createSubqueryExpr(TypeCheckCtx ctx, ASTNode expr, SubqueryType subqueryType, Object[] inputs) throws CalciteSubquerySemanticException
createSubqueryExpr in class ExprFactory<ExprNodeDesc>CalciteSubquerySemanticExceptionprotected FunctionInfo getFunctionInfo(String funcName) throws SemanticException
getFunctionInfo in class ExprFactory<ExprNodeDesc>SemanticExceptionprotected ExprNodeDesc replaceFieldNamesInStruct(ExprNodeDesc expr, List<String> newFieldNames)
replaceFieldNamesInStruct in class ExprFactory<ExprNodeDesc>Copyright © 2022 The Apache Software Foundation. All rights reserved.