Class Coalesce

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class Coalesce
    extends SimpleFunction
    Implementation of the COALESCE(a, b, ...) SQL function, returns the first non-NULL argument. The function's return-type is reported to be whatever the first argument's type is. This function requires at least one argument to be specified.
    • Constructor Summary

      Constructors 
      Constructor Description
      Coalesce()  
    • Constructor Detail

      • Coalesce

        public Coalesce()
    • Method Detail

      • getReturnType

        public ColumnType getReturnType​(java.util.List<Expression> args,
                                        Schema schema)
        Description copied from class: ScalarFunction
        Returns the column type of the resulting column after applying the function. This generally depends on the column type of the inputs.
        Specified by:
        getReturnType in class ScalarFunction
        Parameters:
        args - the arguments to the function call
        schema - the schema of the table
        Returns:
        the column type of the resulting column
      • evaluate

        public java.lang.Object evaluate​(Environment env,
                                         java.util.List<Expression> args)
        Description copied from class: SimpleFunction
        Evaluates the function. Should be called at runtime for every function call.
        Specified by:
        evaluate in class SimpleFunction
        Parameters:
        env - Environment, in which the arguments are evaluated
        args - Arguments for this function
        Returns:
        The value of the function