Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15900#discussion_r88289046
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala
 ---
    @@ -1371,4 +1371,23 @@ class MetastoreDataSourcesSuite extends QueryTest 
with SQLTestUtils with TestHiv
           }
         }
       }
    +
    +  test("SPARK-18464: support old table which doesn't store schema in table 
properties") {
    +    withTable("old") {
    +      withTempPath { path =>
    +        Seq(1 -> "a").toDF("i", "j").write.parquet(path.getAbsolutePath)
    +        val tableDesc = CatalogTable(
    +          identifier = TableIdentifier("old", Some("default")),
    +          tableType = CatalogTableType.EXTERNAL,
    +          storage = CatalogStorageFormat.empty.copy(
    +            properties = Map("path" -> path.getAbsolutePath)
    +          ),
    +          schema = new StructType(),
    +          properties = Map(
    +            HiveExternalCatalog.DATASOURCE_PROVIDER -> "parquet"))
    +        hiveClient.createTable(tableDesc, ignoreIfExists = false)
    +        checkAnswer(spark.table("old"), Row(1, "a"))
    +      }
    +    }
    +  }
    --- End diff --
    
    It will be good to actually create a set of compatibility tests to make 
sure a new version of Spark can access table metadata created by a older 
version (starting from Spark 1.3) without problem. Let's create a follow-up 
jira for this task and do it during the QA period of spark 2.1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to