nsivabalan commented on code in PR #8384:
URL: https://github.com/apache/hudi/pull/8384#discussion_r1170049570
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/TestAlterTableDropPartition.scala:
##########
@@ -320,9 +364,26 @@ class TestAlterTableDropPartition extends
HoodieSparkSqlTestBase {
| )
|""".stripMargin)
+ df.write.format("hudi")
+ .option(HoodieWriteConfig.TBL_NAME.key, tableName)
+ .option(TABLE_TYPE.key, COW_TABLE_TYPE_OPT_VAL)
+ .option(RECORDKEY_FIELD.key, "id")
+ .option(PRECOMBINE_FIELD.key, "ts")
+ .option(PARTITIONPATH_FIELD.key, "year,month,day")
+ .option(HIVE_STYLE_PARTITIONING.key, hiveStyle)
+ .option(KEYGENERATOR_CLASS_NAME.key,
classOf[ComplexKeyGenerator].getName)
+ .option(HoodieWriteConfig.INSERT_PARALLELISM_VALUE.key, "1")
+ .option(HoodieWriteConfig.UPSERT_PARALLELISM_VALUE.key, "1")
+ .mode(SaveMode.Append)
+ .save(tablePath)
+
// drop 2021-10-01 partition
spark.sql(s"alter table $tableName drop partition (year='2021',
month='10', day='01')")
+ // trigger clean so that partition deletion kicks in.
+ spark.sql(s"call run_clean(table => '$tableName', retain_commits =>
1)")
+ .collect()
+
Review Comment:
in L394, we already assert that entire partition dir does not exist. I felt
that should suffice.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]