Variable arguments
MYDB.SCHEMA(MYUSER)=> CREATE FUNCTION greatest_value(VARARGS) RETURNS
INT64...Within the body of the function, the code must process the input values and manage them as needed. For example, the function body should verify the data types of the input arguments and either cast or error out as applicable. You must design your UDX code to handle the local data type of the input values, such as managing Numeric32Val versus double data types. If you were hardcoding the input values, you can declare the input as func(double) and when invoked with a numeric, the system would cast it to double for you.
You can use variable argument signatures to create one function or aggregate that can be used for different combinations of input types. This simplifies the development of your UDFs, UDAs, and UDTFs and reduces the need to create overloaded definitions that do the same task for different types and numbers of arguments.