Uploaded image for project: 'Apache Hudi'
  1. Apache Hudi
  2. HUDI-415

HoodieSparkSqlWriter Commit time not representing the Spark job starting time

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5.1
    • Component/s: None

      Description

      Hudi records the commit time after the first action complete. If there is a heavy transformation before isEmpty(), then the commit time could be inaccurate.

      if (hoodieRecords.isEmpty()) { 
      log.info("new batch has no new records, skipping...") 
      return (true, common.util.Option.empty()) 
      } 
      commitTime = client.startCommit() 
      writeStatuses = DataSourceUtils.doWriteOperation(client, hoodieRecords, commitTime, operation)
      

      For example, I start the spark job at 201901010000, but isEmpty() ran for 2 hours, then the commit time in the .hoodie folder will be 201901010*2*00. If I use the commit time to ingest data starting from 201901010200(from HDFS, not using deltastreamer), then I will miss 2 hours of data.

      Is this set up intended? Can we move the commit time before isEmpty()?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                garyli1019 Yanjia Gary Li
                Reporter:
                garyli1019 Yanjia Gary Li
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m