Github user xwu0226 commented on a diff in the pull request:
https://github.com/apache/spark/pull/12804#discussion_r62546051
--- 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 --
@yhuai Thanks for your input!. Yes, you are right. I can get the
CatalogTable.storage.serdeProperties to check the 'PATH' key. I will modify the
test case.
---
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]