Github user janewangfb commented on a diff in the pull request:
https://github.com/apache/spark/pull/18975#discussion_r137605311
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLParserSuite.scala
---
@@ -524,6 +525,50 @@ class DDLParserSuite extends PlanTest with
SharedSQLContext {
assert(e.message.contains("you can only specify one of them."))
}
+ test("insert overwrite directory") {
+ val v1 = "INSERT OVERWRITE DIRECTORY '/tmp/file' USING parquet SELECT
1 as a"
+ parser.parsePlan(v1) match {
+ case InsertIntoDir(_, storage, provider, query, overwrite) =>
+ assert(storage.locationUri != None &&
storage.locationUri.get.toString == "/tmp/file")
+ case other =>
+ fail(s"Expected to parse
${classOf[InsertIntoDataSourceDirCommand].getClass.getName}" +
+ " from query," + s"got ${other.getClass.getName}: $v1")
--- End diff --
updated.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]