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

    https://github.com/apache/spark/pull/15900#discussion_r88289527
  
    --- 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 --
    
    Can we also test `describe table` and make sure it can provide correct 
column info?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to