Skip to content

Instantly share code, notes, and snippets.

@obar1
Created March 14, 2017 07:40
Show Gist options
  • Select an option

  • Save obar1/ec99eb06dfb8a9383cea60bd76fe64f0 to your computer and use it in GitHub Desktop.

Select an option

Save obar1/ec99eb06dfb8a9383cea60bd76fe64f0 to your computer and use it in GitHub Desktop.
pyspark submit
from pyspark import SparkContext, SparkConf
conf = SparkConf().setAppName("myPyspark")
sc = SparkContext(conf=conf)
dataRDD = sc.textFile("/user/ma186082/sqoop_import/departments")
for line in dataRDD.collect():
print(line)
dataRDD.saveAsTextFile("/user/ma186082/pyspark/departments")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment