dongjoon-hyun commented on code in PR #38430: URL: https://github.com/apache/spark/pull/38430#discussion_r1011869341
########## sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLog.scala: ########## @@ -168,7 +191,13 @@ class HDFSMetadataLog[T <: AnyRef : ClassTag](sparkSession: SparkSession, path: * valid behavior, we still need to prevent it from destroying the files. */ def addNewBatchByStream(batchId: Long)(fn: OutputStream => Unit): Boolean = { - get(batchId).map(_ => false).getOrElse { + + val batchMetadataFile = batchIdToPath(batchId) + + if ((metadataCacheEnabled && batchCache.containsKey(batchId)) + || fileManager.exists(batchMetadataFile)) { Review Comment: nit. Indentation? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org