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

25,405

Your version specified in Maven is too old. SparkSession is introduced in Spark 2.0. Your need to use Spark 2.0.0 or later to import it. The answers of question below may help you to configure the details:

What is version library spark supported SparkSession

Share:
25,405
phani
Author by

phani

Technology has always lured me. Love to code, living to travel.

Updated on January 03, 2020

Comments

  • phani
    phani over 4 years

    I am trying to use the latest Spark api with SparkSession.

    While i am importing the package, my eclipse is showing an error show in attachment.

    I am using 2.10.6 scala compiler.

    Please help me to resolve this issue.

    pom code

    • mrsrinivas
      mrsrinivas over 7 years
      you spark-sql and spark-core versions are inconsistent. try using either cdh or apache.
    • Tzach Zohar
      Tzach Zohar over 7 years
      @mrsrinivas and - they are both very old and therefore do not contain the new SparkSeesion - use 2.0.0 or later