yihua commented on code in PR #9510:
URL: https://github.com/apache/hudi/pull/9510#discussion_r1305990912


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieStreamingSink.scala:
##########
@@ -318,14 +318,18 @@ class HoodieStreamingSink(sqlContext: SQLContext,
 
   private def canSkipBatch(incomingBatchId: Long, operationType: String): 
Boolean = {
     if (!DELETE_OPERATION_OPT_VAL.equals(operationType)) {
-      val identifier = 
options.getOrElse(STREAMING_CHECKPOINT_IDENTIFIER.key(), 
STREAMING_CHECKPOINT_IDENTIFIER.defaultValue())
-      // get the latest checkpoint from the commit metadata to check if the 
microbatch has already been processed or not
-      val lastCheckpoint = CommitUtils.getValidCheckpointForCurrentWriter(
-        metaClient.get.getActiveTimeline.getWriteTimeline, 
SINK_CHECKPOINT_KEY, identifier)
-      if (lastCheckpoint.isPresent) {
-        latestCommittedBatchId = lastCheckpoint.get().toLong
+      if(incomingBatchId == 0) {
+         false

Review Comment:
   The batch 0 may have already been processed so the last checkpoint still 
needs to be read.  Correct?



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to