Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/15688#discussion_r85834452
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
---
@@ -1636,15 +1635,23 @@ class DDLSuite extends QueryTest with
SharedSQLContext with BeforeAndAfterEach {
}
withTable("rectangles", "rectangles2") {
+ val data = (1 to 10).map { i => (i % 3, i % 5, i) }.toDF("width",
"length", "height")
+
data.write.saveAsTable("rectangles")
- data.write.partitionBy("length").saveAsTable("rectangles2")
+ data.write.partitionBy("width", "length").saveAsTable("rectangles2")
// not supported since the table is not partitioned
assertUnsupported("TRUNCATE TABLE rectangles PARTITION (width=1)")
// supported since partitions are stored in the metastore
+ sql("TRUNCATE TABLE rectangles2 PARTITION (width=1, length=1)")
--- End diff --
If we try to truncate a partition that does not exist, we just do nothing?
---
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]