Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the active SparkSession for the current thread, returned by the builder.
Syntax
SparkSession.getActiveSession()
Returns
SparkSession or None
Examples
s = SparkSession.getActiveSession()
df = s.createDataFrame([('Alice', 1)], ['name', 'age'])
df.select("age").show()
# +---+
# |age|
# +---+
# | 1|
# +---+