Class FunctionReplacementUtils
java.lang.Object
org.apache.drill.common.expression.fn.FunctionReplacementUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetCastFunc(TypeProtos.MinorType targetMinorType) Given the target type, get the appropriate cast functionstatic StringgetReplacingFunction(String functionName, TypeProtos.DataMode dataMode, TypeProtos.MinorType inputType) Get a replacing function for the original function, based on the specified data modestatic booleanisCastFunction(String functionName) Check if a function is a cast function.static booleanisReplacementNeeded(String functionName, TypeProtos.MinorType inputType) Check if a replacing function is available for the the original function
-
Constructor Details
-
FunctionReplacementUtils
public FunctionReplacementUtils()
-
-
Method Details
-
getCastFunc
Given the target type, get the appropriate cast function- Parameters:
targetMinorType- the target data type- Returns:
- the name of cast function
-
getReplacingFunction
public static String getReplacingFunction(String functionName, TypeProtos.DataMode dataMode, TypeProtos.MinorType inputType) Get a replacing function for the original function, based on the specified data mode- Parameters:
functionName- original function namedataMode- data mode of the input datainputType- input (minor) type- Returns:
- the name of replaced function
-
isReplacementNeeded
Check if a replacing function is available for the the original function- Parameters:
functionName- original function nameinputType- input (minor) type- Returns:
trueif replacement is needed,falseotherwise
-
isCastFunction
Check if a function is a cast function.- Parameters:
functionName- name of the function- Returns:
trueif function is CAST function,falseotherwise
-