Reply
Expert Contributor
Posts: 139
Registered: ‎07-21-2014

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

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!

Cloudera Employee
Posts: 366
Registered: ‎07-29-2013

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

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

Expert Contributor
Posts: 139
Registered: ‎07-21-2014

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

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._

Expert Contributor
Posts: 139
Registered: ‎07-21-2014

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

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

Highlighted
New Contributor
Posts: 11
Registered: ‎07-21-2015

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

Hi,

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

 

Thanks in advance.