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, NaTType, float64, list, tuple, dict]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L8113-L8136)

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
语言: 中文