Skip to content

Commit

Permalink
Merge pull request #71 from rajdeepd/branch-ed2
Browse files Browse the repository at this point in the history
fixed minor issues in Chapter 4 and 1
  • Loading branch information
rajdeepd authored May 16, 2017
2 parents 59f73c0 + da7f298 commit 95f8470
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion Chapter_01/python-spark-app/pythonapp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
"""A simple Spark app in Python"""
import os
import sys
os.environ['SPARK_HOME']="/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/"
SPARK_HOME = os.environ['SPARK_HOME']

# Add the PySpark/py4j to the Python Path
sys.path.insert(0, os.path.join(SPARK_HOME, "python", "lib"))
sys.path.insert(0, os.path.join(SPARK_HOME, "python"))
from pyspark import SparkContext
from pyspark import SparkConf

os.environ['SPARK_HOME']="/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/"


# Append pyspark to Python Path
sys.path.append("/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7")
Expand Down
3 changes: 2 additions & 1 deletion Chapter_04/python/2.0.0/com/sparksamples/util.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os
import sys
from pyspark.sql.types import *

PATH = "/home/ubuntu/work/ml-resources/spark-ml/data"
SPARK_HOME = "/home/ubuntu/work/spark-2.0.0-bin-hadoop2.7/"

os.environ['SPARK_HOME'] = SPARK_HOME
sys.path.append(SPARK_HOME + "/python")

from pyspark.sql.types import *
from pyspark import SparkContext
from pyspark import SparkConf
from pyspark.sql import SparkSession
Expand Down
7 changes: 4 additions & 3 deletions Chapter_10/scala-2.0.x/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ version := "1.0"

scalaVersion := "2.11.7"

libraryDependencies += "org.apache.spark" %% "spark-core" % "2.0.2"
libraryDependencies += "org.apache.spark" %% "spark-mllib" % "2.0.2"

libraryDependencies += "org.apache.spark" %% "spark-core" % "2.1.0"
libraryDependencies += "org.apache.spark" %% "spark-mllib" % "2.1.0"
libraryDependencies += "com.roundeights" %% "hasher" % "1.2.0"
libraryDependencies += "org.mindrot" % "jbcrypt" % "0.3m"

1 comment on commit 95f8470

@zou-xuan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Rajdeep,
I think only changing the location of import does not help, like in util.py you should delete the import * in functions.

Please sign in to comment.