Class FunctionReplacementUtils

java.lang.Object
org.apache.drill.common.expression.fn.FunctionReplacementUtils

public class FunctionReplacementUtils extends Object
  • Constructor Details

    • FunctionReplacementUtils

      public FunctionReplacementUtils()
  • Method Details

    • getCastFunc

      public static String getCastFunc(TypeProtos.MinorType targetMinorType)
      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 name
      dataMode - data mode of the input data
      inputType - input (minor) type
      Returns:
      the name of replaced function
    • isReplacementNeeded

      public static boolean isReplacementNeeded(String functionName, TypeProtos.MinorType inputType)
      Check if a replacing function is available for the the original function
      Parameters:
      functionName - original function name
      inputType - input (minor) type
      Returns:
      true if replacement is needed, false otherwise
    • isCastFunction

      public static boolean isCastFunction(String functionName)
      Check if a function is a cast function.
      Parameters:
      functionName - name of the function
      Returns:
      true if function is CAST function, false otherwise