Created
January 7, 2021 19:04
-
-
Save farooqarahim/d79f827b72ed6113b616cd19e9eb33a8 to your computer and use it in GitHub Desktop.
Revisions
-
farooqarahim created this gist
Jan 7, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ import findspark findspark.init() from pyspark.sql import SparkSession # Connect to Remote Spark Deployment # spark = SparkSession \ # .builder.master('spark://master-node:7077') \ # .appName("read-csv") \ # .getOrCreate() spark = SparkSession \ .builder \ .appName("read-csv") \ .getOrCreate() df = spark.read.option("header",True).csv('./csv-file.csv') type(df) df.printSchema() # df.show(10,False) df.dtypes