stream2000 commented on code in PR #10390:
URL: https://github.com/apache/hudi/pull/10390#discussion_r1445555086
##########
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:
Can we use replace commit here to provide the transaction mechanism? We have
already done it for partitioned table
--
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]