Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/16672#discussion_r100882025
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
---
@@ -1816,4 +1816,127 @@ class DDLSuite extends QueryTest with
SharedSQLContext with BeforeAndAfterEach {
}
}
}
+
+ test("insert data to a data source table which has a not existed
location should succeed") {
+ withTable("t") {
+ withTempDir { dir =>
+ spark.sql(
+ s"""
+ |CREATE TABLE t(a string, b int)
+ |USING parquet
+ |OPTIONS(path "file:${dir.getCanonicalPath}")
--- End diff --
- First, you do not need to add the `file:`
- Second, you still need to adjust the indent.
```Scala
spark.sql(
s"""
|CREATE TABLE t(a int, b int, c int, d int)
|USING parquet
|PARTITIONED BY(a, b)
|LOCATION '$dir'
""".stripMargin)
val expectedPath = dir.getAbsolutePath.stripSuffix("/")
```
---
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]