spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Armbrust <mich...@databricks.com>
Subject Re: Spark SQL standalone application compile error
Date Tue, 10 Jun 2014 04:37:59 GMT
You need to add the following to your sbt file:

libraryDependencies += "org.apache.spark" %% "spark-sql" % "1.0.0"


On Mon, Jun 9, 2014 at 9:25 PM, shlee0605 <shlee0605@gmail.com> wrote:

> I am having some trouble with compiling Spark standalone application that
> uses new Spark SQL feature.
> I have used the exact same code from "RDDRelation.scala" that is included
> in
> Spark's examples.
>
> I set my build.sbt file like as follows:
>
> name := "spark-sql"
>
> version := "1.0"
>
> scalaVersion := "2.10.4"
>
> libraryDependencies += "org.apache.spark" %% "spark-core" % "1.0.0"
>
> resolvers += "Akka Repository" at "http://repo.akka.io/releases/"
>
> When I try to compile, I get the following error:
>
> [error]
>
> /home/shlee0605/shlee_test/spark-sample-project/src/main/scala/spark/example/Main.scala:5:
> object sql is not a member of package org.apache.spark
> [error] import org.apache.spark.sql.SQLContext
> [error]                         ^
> [error]
>
> /home/shlee0605/shlee_test/spark-sample-project/src/main/scala/spark/example/Main.scala:20:
> not found: type SQLContext
> [error]     val sqlContext = new SQLContext(sc)
> [error]                          ^
> ...
>
> By the way, when I ran the same code line by line from the spark-shell, it
> worked well.
> How can I fix this?
>
> Thanks,
> Seunghyun Lee
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/Spark-SQL-standalone-application-compile-error-tp7298.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>

Mime
View raw message