Skip to content

Instantly share code, notes, and snippets.

@dharma6872
Last active January 13, 2021 05:48
Show Gist options
  • Save dharma6872/dcc7b732fff21db17e199128e17f0b72 to your computer and use it in GitHub Desktop.
Save dharma6872/dcc7b732fff21db17e199128e17f0b72 to your computer and use it in GitHub Desktop.
[Create SparkSession]스파크 세션 생성 예시 #pyspark #pyspark101
# Importing Spark Related Packages
from pyspark.sql import SparkSession
if __name__ == "__main__":
print("PySpark 101 Tutorial")
print("Part 1. How to create SparkSession object in PySpark using PyCharm IDE")
spark = SparkSession \
.builder \
.appName("Part 1. How to create SparkSession object in PySpark using PyCharm IDE") \
.master("local[*]") \
.enableHiveSupport() \
.getOrCreate()
print(spark)
print(spark.sparkContext)
print(dir(spark.sparkContext))
print("Stopping the SparkSession object")
spark.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment