sunchao commented on a change in pull request #30979:
URL: https://github.com/apache/spark/pull/30979#discussion_r550332349
##########
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:
Hmm interesting... I thought this should have been addressed via #30699
but maybe it's a different one. I'll check this when I have time too.
----------------------------------------------------------------
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]