Class FunctionReplacementUtils
java.lang.Object
org.apache.drill.common.expression.fn.FunctionReplacementUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getCastFunc
(TypeProtos.MinorType targetMinorType) Given the target type, get the appropriate cast functionstatic String
getReplacingFunction
(String functionName, TypeProtos.DataMode dataMode, TypeProtos.MinorType inputType) Get a replacing function for the original function, based on the specified data modestatic boolean
isCastFunction
(String functionName) Check if a function is a cast function.static boolean
isReplacementNeeded
(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:
true
if replacement is needed,false
otherwise
-
isCastFunction
Check if a function is a cast function.- Parameters:
functionName
- name of the function- Returns:
true
if function is CAST function,false
otherwise
-