Skip to content

Instantly share code, notes, and snippets.

@kgorman
Created February 24, 2015 03:12
Show Gist options
  • Save kgorman/4e0e0d933d9fae4571e8 to your computer and use it in GitHub Desktop.
Save kgorman/4e0e0d933d9fae4571e8 to your computer and use it in GitHub Desktop.
Ipython plus Spark
import sys
import os
sys.path.append("/usr/lib/spark-yarn/python")
os.environ["SPARK_HOME"]="/usr/lib/spark-yarn/"
from pyspark import SparkContext
from pyspark import SparkConf
conf=SparkConf()
conf.set("spark.executor.memory", "10m")
conf.set("spark.cores.max", "2")
sc
sc = SparkContext('local[4]', conf=conf)
sc
words = sc.textFile('hdfs://NAMENODE-1/user/kgorman/testme.txt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment