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

Persistent view stored in Hive metastore should be case preserving.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: SQL
    • Labels:
      None
    • Target Version/s:

      Description

          withView("view1") {
            spark.sql("CREATE VIEW view1 AS SELECT 1 AS cAsEpReSeRvE, 2 AS aBcD")
            val metadata = new MetadataBuilder().putString(types.HIVE_TYPE_STRING, "int").build()
      
            val expectedSchema = StructType(List(
              StructField("cAsEpReSeRvE", IntegerType, nullable = false, metadata),
              StructField("aBcD", IntegerType, nullable = false, metadata)))
            assert(spark.table("view1").schema == expectedSchema, "Schema should match")
            checkAnswer(
              sql("select aBcD, cAsEpReSeRvE from view1"),
              Row(2, 1))
          }
      

      The column names of persistent view stored in Hive metastore should be case preserving.

        Attachments

          Activity

            People

            • Assignee:
              cloud_fan Wenchen Fan
              Reporter:
              smilegator Xiao Li
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: