PySparkリファレンスクラスSparkSessiongetActiveSessionこのページの見出しgetActiveSession ビルダーによって返された、現在のスレッドのアクティブなSparkSessionを返します。 構文 SparkSession.getActiveSession() 戻り値 SparkSession または None 例 Pythons = SparkSession.getActiveSession()df = s.createDataFrame([('Alice', 1)], ['name', 'age'])df.select("age").show()# +---+# |age|# +---+# | 1|# +---+