sunchao commented on a change in pull request #30979:
URL: https://github.com/apache/spark/pull/30979#discussion_r550296192
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableDropPartitionSuite.scala
##########
@@ -42,6 +42,18 @@ trait AlterTableDropPartitionSuiteBase extends
command.AlterTableDropPartitionSu
checkPartitions(t) // no partitions
}
}
+
+ test("SPARK-33941: invalidate cache after partition dropping") {
Review comment:
nit: perhaps it's more accurate to call this "refresh cache" instead of
"invalidate cache".
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableDropPartitionSuite.scala
##########
@@ -42,6 +42,18 @@ trait AlterTableDropPartitionSuiteBase extends
command.AlterTableDropPartitionSu
checkPartitions(t) // no partitions
}
}
+
+ test("SPARK-33941: invalidate cache after partition dropping") {
+ withNamespaceAndTable("ns", "tbl") { t =>
+ sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY
(part)")
+ sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0")
+ val df = spark.table(t)
+ df.cache()
+ assert(!df.isEmpty)
+ sql(s"ALTER TABLE $t DROP PARTITION (part=0)")
+ assert(df.isEmpty)
Review comment:
can we check that the cache still exist after the command? this will
validate that the cache is actually refreshed rather than removed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]