cloud-fan commented on code in PR #52157: URL: https://github.com/apache/spark/pull/52157#discussion_r2312810434
########## sql/core/src/test/scala/org/apache/spark/sql/execution/QueryExecutionSuite.scala: ########## @@ -327,6 +327,41 @@ class QueryExecutionSuite extends SharedSparkSession { } } + test("SPARK-53413: Cleanup shuffle dependencies for commands") { + Seq(true, false).foreach { adaptiveEnabled => { + withSQLConf((SQLConf.ADAPTIVE_EXECUTION_ENABLED.key, adaptiveEnabled.toString), + (SQLConf.CLASSIC_SHUFFLE_DEPENDENCY_FILE_CLEANUP_ENABLED.key, true.toString)) { + val plan = spark.range(100).repartition(10).logicalPlan + val df = Dataset.ofRows(spark, plan) + df.write.format("noop").mode(SaveMode.Overwrite).save() + + val blockManager = spark.sparkContext.env.blockManager + assert(blockManager.migratableResolver.getStoredShuffles().isEmpty) + assert(blockManager.diskBlockManager.getAllBlocks().isEmpty) + } + } + } + } + + test("SPARK-53413: Cleanup shuffle dependencies for DataWritingCommandExec") { + withTempDir { dir => + Seq(true, false).foreach { adaptiveEnabled => { + withSQLConf((SQLConf.ADAPTIVE_EXECUTION_ENABLED.key, adaptiveEnabled.toString), + (SQLConf.CLASSIC_SHUFFLE_DEPENDENCY_FILE_CLEANUP_ENABLED.key, true.toString)) { + val plan = spark.range(100).repartition(10).logicalPlan + val df = Dataset.ofRows(spark, plan) + // V1 API write + df.write.format("parquet").mode(SaveMode.Overwrite).save(dir.getCanonicalPath) Review Comment: super nit: writing JSON/CSV is faster for tests. -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org