Skip to content

Commit b7f2b15

Browse files
committed
Add a v1 test
1 parent 87d214f commit b7f2b15

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableDropPartitionSuite.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ import org.apache.spark.sql.execution.command
2121

2222
trait AlterTableDropPartitionSuiteBase extends command.AlterTableDropPartitionSuiteBase {
2323
override protected val notFullPartitionSpecErr = "The following partitions not found in table"
24+
25+
test("purge partition data") {
26+
withNamespaceAndTable("ns", "tbl") { t =>
27+
sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)")
28+
sql(s"ALTER TABLE $t ADD PARTITION (id = 1)")
29+
checkPartitions(t, Map("id" -> "1"))
30+
sql(s"ALTER TABLE $t DROP PARTITION (id = 1) PURGE")
31+
checkPartitions(t) // no partitions
32+
}
33+
}
2434
}
2535

2636
class AlterTableDropPartitionSuite

0 commit comments

Comments
 (0)