danny0405 commented on code in PR #10390:
URL: https://github.com/apache/hudi/pull/10390#discussion_r1435447602
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/command/TruncateHoodieTableCommand.scala:
##########
@@ -68,7 +71,12 @@ case class TruncateHoodieTableCommand(
val targetPath = new Path(basePath)
val engineContext = new
HoodieSparkEngineContext(sparkSession.sparkContext)
val fs = FSUtils.getFs(basePath,
sparkSession.sparkContext.hadoopConfiguration)
+ val hoodieWriteConfig =
HoodieWriteConfig.newBuilder().withPath(basePath).withProps(properties).withEngineType(EngineType.SPARK)
+ .build()
+ val transactionManager = new TransactionManager(hoodieWriteConfig, fs)
+
transactionManager.beginTransaction(org.apache.hudi.common.util.Option.empty(),
org.apache.hudi.common.util.Option.empty())
FSUtils.deleteDir(engineContext, fs, targetPath,
sparkSession.sparkContext.defaultParallelism)
+
transactionManager.endTransaction(org.apache.hudi.common.util.Option.empty())
Review Comment:
But between the `beginTransaction` and `endTransaction`, we only delete some
files from the table, there is no new commit metadata genetated, so how the txn
manager can help here(detect the conflicts)?
--
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]