Bagikan melalui


current_user

Mengembalikan database saat ini.

Syntax

from pyspark.sql import functions as sf

sf.current_user()

Examples

Contoh 1: Dapatkan pengguna saat ini

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