Skip to content

Commit

Permalink
remove ambuigity
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryshao committed Jun 2, 2022
1 parent 7aab2fa commit 502872e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

package org.apache.spark.sql.hudi.command.procedures

import org.apache.hudi.client.common.HoodieSparkEngineContext
import org.apache.hudi.common.engine.HoodieEngineContext
import org.apache.hudi.common.table.HoodieTableMetaClient
import org.apache.hudi.common.table.timeline.versioning.TimelineLayoutVersion
import org.apache.hudi.common.util.Option
import org.apache.hudi.table.HoodieSparkTable
import org.apache.hudi.table.marker.WriteMarkersFactory
import org.apache.spark.internal.Logging
Expand Down Expand Up @@ -52,7 +56,13 @@ class DeleteMarkerProcedure extends BaseProcedure with ProcedureBuilder with Log
val client = createHoodieClient(jsc, basePath)
val config = client.getConfig
val context = client.getEngineContext
val table = HoodieSparkTable.create(config, context : HoodieEngineContext, true)
val metaClient = HoodieTableMetaClient.builder()
.setConf(context.getHadoopConf.get).setBasePath(config.getBasePath)
.setLoadActiveTimelineOnLoad(true).setConsistencyGuardConfig(config.getConsistencyGuardConfig)
.setLayoutVersion(Option.of(new TimelineLayoutVersion(config.getTimelineLayoutVersion)))
.setFileSystemRetryConfig(config.getFileSystemRetryConfig).setProperties(config.getProps)
.build
val table = HoodieSparkTable.create(config, context.asInstanceOf[HoodieSparkEngineContext], metaClient, true)
WriteMarkersFactory.get(config.getMarkersType, table, instantTime)
.quietDeleteMarkerDir(context, config.getMarkersDeleteParallelism)
} match {
Expand Down

0 comments on commit 502872e

Please sign in to comment.