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

SQL add jar command does not work well with Scala REPL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • 1.4.0, 2.1.0
    • None
    • SQL
    • None

    Description

      Seems SparkIMain always resets the context class loader in loadAndRunReq. So, SerDe added through add jar command may not be loaded in the context class loader when we lookup the table.
      For example, the following code will fail when we try to show the table.

      hive.sql("add jar sql/hive/src/test/resources/hive-hcatalog-core-0.13.1.jar")
      hive.sql("drop table if exists jsonTable")
      hive.sql("CREATE TABLE jsonTable(key int, val string) ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'")
      hive.createDataFrame((1 to 100).map(i => (i, s"str$i"))).toDF("key", "val").insertInto("jsonTable")
      hive.table("jsonTable").show
      

      Attachments

        Issue Links

          Activity

            People

              yhuai Yin Huai
              yhuai Yin Huai
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: