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

    https://github.com/apache/spark/pull/12804#discussion_r62541948
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala
 ---
    @@ -1033,4 +1035,23 @@ class MetastoreDataSourcesSuite extends QueryTest 
with SQLTestUtils with TestHiv
           }
         }
       }
    +
    +  test("SPARK-15025: create datasource table with path with select") {
    +    withTempPath { dir =>
    +      withTable("t") {
    +        val path = dir.getCanonicalPath
    +
    +        sql(
    +          s"""CREATE TABLE t USING PARQUET
    +             |OPTIONS (PATH '$path')
    +             |AS SELECT 1 AS a, 2 AS b, 3 AS c
    +           """.stripMargin
    +        )
    +        sql("insert into t values (2, 3, 4)")
    +        checkAnswer(table("t"), Seq(Row(1, 2, 3), Row(2, 3, 4)))
    +        assert(sessionState.metadataHive.runSqlHive("select * from t order 
by a") ===
    +          Seq("1\t2\t3", "2\t3\t4"))
    --- End diff --
    
    Can we avoid of calling `metadataHive.runSqlHive`? For this case, we want 
to check that there is a single entry in table properties with the key as 
`PATH` and the location is the one we want, right?


---
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