Created
October 27, 2015 16:04
-
-
Save thekensta/66de6195e7d95e8a7f58 to your computer and use it in GitHub Desktop.
Spark Shell Script
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
# submit with spark-submit hello_pyspark.py | |
# Spark 1.5.1 | |
from pyspark import SparkContext, SparkConf | |
from pyspark.sql import SQLContext | |
conf = SparkConf().setAppName("showMeTheSchema").setMaster("local") | |
sc = SparkContext(conf=conf) | |
sqlContext = SQLContext(sc) | |
df = sqlContext.read.json("data/20151026/*.gz") | |
df.printSchema() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment