Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

error: object sql is not a member of package org.apache.spark

avatar
Expert Contributor

I'm creating a simple SparkSQL app based on this post by Sandy:

  http://blog.cloudera.com/blog/2014/04/how-to-run-a-simple-apache-spark-app-in-cdh-5/

 

But 'mvn package' gives throws error:

  error: object sql is not a member of package org.apache.spark 

 

Any idea if I need to include any other dependency?

 

Thanks!

4 REPLIES 4

avatar
Master Collaborator

It sounds like you did not add a dependency on Spark SQL in your project. The artifact ID is "spark-sql_2.10"

avatar
Expert Contributor

Thanks Sean, now I get this:

 

 error: object SQLContext is not a member of package org.apache.spark.sql

[INFO] Note: class SQLContext exists, but it has no companion object.

[INFO] import org.apache.spark.sql.SQLContext._

avatar
Expert Contributor

After removing the import, I was able to compile the package successfully.

avatar
Contributor

Hi,

Can you please post the exact order of your imports? I am having the same issue.

 

Thanks in advance.