You are viewing documentation about an older version (1.2.0). View latest version

snowflake.snowpark.functions.call_function¶

snowflake.snowpark.functions.call_function(function_name: str, *args: ColumnOrLiteral) → 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