Last active
January 13, 2021 05:48
-
-
Save dharma6872/dcc7b732fff21db17e199128e17f0b72 to your computer and use it in GitHub Desktop.
[Create SparkSession]스파크 세션 생성 예시 #pyspark #pyspark101
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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