snowflake.snowpark.functions.current_user

snowflake.snowpark.functions.current_user() Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L355-L364)

Returns the name of the user currently logged into the system.

Example

>>> # Return result is tied to session, so we only test if the result exists
>>> result = session.create_dataframe([1]).select(current_user()).collect()
>>> assert result[0]['CURRENT_USER()'] is not None
Copy
语言: 中文