pyspark.sql.functions.session_user#

pyspark.sql.functions.session_user()[source]#

Returns the user name of current execution context.

New in version 4.0.0.

Examples

>>> import pyspark.sql.functions as sf
>>> spark.range(1).select(sf.session_user()).show() 
+--------------+
|session_user()|
+--------------+
| ruifeng.zheng|
+--------------+