You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/01/30 14:07:51 UTC

[GitHub] [hudi] pengzhiwei2018 commented on a change in pull request #2296: [HUDI-1425] Performance loss with the additional hoodieRecords.isEmpt…

pengzhiwei2018 commented on a change in pull request #2296:
URL: https://github.com/apache/hudi/pull/2296#discussion_r567250220



##########
File path: hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestCOWDataSource.scala
##########
@@ -320,4 +320,21 @@ class TestCOWDataSource extends HoodieClientTestBase {
 
     assertTrue(HoodieDataSourceHelpers.hasNewCommits(fs, basePath, "000"))
   }
+
+  @Test def testWithEmptyInput(): Unit = {
+    val inputDF1 = spark.read.json(spark.sparkContext.parallelize(Seq.empty[String], 1))
+    inputDF1.write.format("org.apache.hudi")
+      .options(commonOpts)
+      .option(DataSourceWriteOptions.OPERATION_OPT_KEY, DataSourceWriteOptions.INSERT_OPERATION_OPT_VAL)
+      .mode(SaveMode.Overwrite)
+      .save(basePath)
+    assertTrue(HoodieDataSourceHelpers.hasNewCommits(fs, basePath, "000"))

Review comment:
       Hi @nsivabalan ,I also agree that not making an empty commit. Because it would produce many useless commit files for streaming job when the source of the streaming is in the business trough. And I have update the code to skip the empty commit.




----------------------------------------------------------------
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.

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