snowflake.snowpark.functions.call_function¶

snowflake.snowpark.functions.call_function(function_name: str, *args: Union[Column, None, bool, int, float, str, bytearray, Decimal, date, datetime, time, bytes, list, tuple, dict]) → Column[source]¶

Invokes a Snowflake system-defined function (built-in function) with the specified name and arguments.

Parameters:
  • function_name – The name of built-in function in Snowflake

  • args –

    Arguments can be in two types:

    • Column, or

    • Basic Python types, which are converted to Snowpark literals.

Example::
>>> df = session.create_dataframe([1, 2, 3, 4], schema=["a"])  # a single column with 4 rows
>>> df.select(call_function("avg", col("a"))).show()
----------------
|"AVG(""A"")"  |
----------------
|2.500000      |
----------------
Copy