Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-24483

enableHiveSupport doesn't work with Spark 2.3 on EMR

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 2.3.0
    • Fix Version/s: None
    • Component/s: Project Infra
    • Labels:
    • Environment:

      EMR v5.13 (Spark 2.3.0)

      Description

      I run a spark job on an EMR cluster when using the SparkSession.Builder to create a spark Session.
      The job includes querying a Hive table, and when it is executed Spark throws "

      org.apache.spark.sql.AnalysisException: Table or view not found".

      I printed all the config options in Spark context and noticed that "spark.sql.catalogImplementation" is missing.

      If I provide this option as a "-conf" in "spark-submit" then it is added and everything works.

      This is the code I use to instantiate the SparkSession:
      val spark: SparkSession = SparkSession

      .builder
      .config("mapreduce.fileoutputcommitter.algorithm.version", "2")
      .enableHiveSupport()
      .getOrCreate()

      Also note that I added the following two debugging statements just before the code that creates the session to see if there was already a session in place, and they both returned "false":

      SparkSession.getActiveSession.isDefined

      SparkSession.getDefaultSession.isDefined

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shauli10 Shaul Lahav
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: