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

MetastoreRelation toJSON throws exception

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.1, 2.1.0
    • SQL
    • None

    Description

      MetastoreRelationSuite.toJSON now throws exception.

      test case:

      package org.apache.spark.sql.hive
      
      import org.apache.spark.SparkFunSuite
      import org.apache.spark.sql.catalyst.TableIdentifier
      import org.apache.spark.sql.catalyst.catalog.{CatalogStorageFormat, CatalogTable, CatalogTableType}
      import org.apache.spark.sql.types.{IntegerType, StructField, StructType}
      
      class MetastoreRelationSuite extends SparkFunSuite {
        test("makeCopy and toJSON should work") {
          val table = CatalogTable(
            identifier = TableIdentifier("test", Some("db")),
            tableType = CatalogTableType.VIEW,
            storage = CatalogStorageFormat.empty,
            schema = StructType(StructField("a", IntegerType, true) :: Nil))
          val relation = MetastoreRelation("db", "test")(table, null, null)
      
          // No exception should be thrown
          relation.makeCopy(Array("db", "test"))
          // No exception should be thrown
          relation.toJSON
        }
      }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            clockfly Sean Zhong
            clockfly Sean Zhong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment