MaxGekk commented on a change in pull request #31017:
URL: https://github.com/apache/spark/pull/31017#discussion_r551567165



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionSuiteBase.scala
##########
@@ -155,4 +155,19 @@ trait AlterTableDropPartitionSuiteBase extends QueryTest 
with DDLCommandTestUtil
       QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(1, 1)))
     }
   }
+
+  test("SPARK-33950, SPARK-33987: refresh 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")
+      sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1")
+      assert(!spark.catalog.isCached(t))
+      sql(s"CACHE TABLE $t")
+      assert(spark.catalog.isCached(t))
+      QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(1, 
1)))

Review comment:
       I had to add `QueryTest` to `checkAnswer` because I got pretty weird 
error when I run the test as part of Hive's test suite:
   ```
   [info] 
org.apache.spark.sql.hive.execution.command.AlterTableDropPartitionSuite *** 
ABORTED *** (19 seconds, 910 milliseconds)
   [info]   java.lang.AbstractMethodError: Method 
org/apache/spark/sql/hive/execution/command/AlterTableDropPartitionSuite.org$apache$spark$sql$execution$command$AlterTableDropPartitionSuiteBase$$super$checkAnswer(Lscala/Function0;Lscala/collection/Seq;)V
 is abstract
   [info]   at 
org.apache.spark.sql.hive.execution.command.AlterTableDropPartitionSuite.org$apache$spark$sql$execution$command$AlterTableDropPartitionSuiteBase$$super$checkAnswer(AlterTableDropPartitionSuite.scala)
   ```
   I don't have any clues what's going on here because `checkAnswer` from the 
`QueryTest` is defined, and it is not abstact.




----------------------------------------------------------------
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]

Reply via email to