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

Running Java client Copy-on-write table results in exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.7.0
    • None
    • bootstrap
    • None

    Description

      Running java client example results in below error

      906206 [main] ERROR org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor - Error upserting bucketType UPDATE for partition :0
      java.util.NoSuchElementException: No value present in Option
      at org.apache.hudi.common.util.Option.get(Option.java:88)
      at org.apache.hudi.io.HoodieMergeHandle.<init>(HoodieMergeHandle.java:83)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.getUpdateHandle(BaseJavaCommitActionExecutor.java:288)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.handleUpdate(BaseJavaCommitActionExecutor.java:264)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.handleUpsertPartition(BaseJavaCommitActionExecutor.java:238)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.lambda$execute$0(BaseJavaCommitActionExecutor.java:118)
      at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.execute(BaseJavaCommitActionExecutor.java:116)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.execute(BaseJavaCommitActionExecutor.java:66)
      at org.apache.hudi.table.action.commit.AbstractWriteHelper.write(AbstractWriteHelper.java:55)
      at org.apache.hudi.table.action.commit.JavaUpsertCommitActionExecutor.execute(JavaUpsertCommitActionExecutor.java:47)
      at org.apache.hudi.table.HoodieJavaCopyOnWriteTable.upsert(HoodieJavaCopyOnWriteTable.java:62)
      at org.apache.hudi.table.HoodieJavaCopyOnWriteTable.upsert(HoodieJavaCopyOnWriteTable.java:50)
      at org.apache.hudi.client.HoodieJavaWriteClient.upsert(HoodieJavaWriteClient.java:101)
      at HoodieJavaWriteClientExample.main(HoodieJavaWriteClientExample.java:104)
      Exception in thread "main" org.apache.hudi.exception.HoodieUpsertException: Error upserting bucketType UPDATE for partition :0
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.handleUpsertPartition(BaseJavaCommitActionExecutor.java:245)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.lambda$execute$0(BaseJavaCommitActionExecutor.java:118)
      at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.execute(BaseJavaCommitActionExecutor.java:116)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.execute(BaseJavaCommitActionExecutor.java:66)
      at org.apache.hudi.table.action.commit.AbstractWriteHelper.write(AbstractWriteHelper.java:55)
      at org.apache.hudi.table.action.commit.JavaUpsertCommitActionExecutor.execute(JavaUpsertCommitActionExecutor.java:47)
      at org.apache.hudi.table.HoodieJavaCopyOnWriteTable.upsert(HoodieJavaCopyOnWriteTable.java:62)
      at org.apache.hudi.table.HoodieJavaCopyOnWriteTable.upsert(HoodieJavaCopyOnWriteTable.java:50)
      at org.apache.hudi.client.HoodieJavaWriteClient.upsert(HoodieJavaWriteClient.java:101)
      at HoodieJavaWriteClientExample.main(HoodieJavaWriteClientExample.java:104)
      Caused by: java.util.NoSuchElementException: No value present in Option
      at org.apache.hudi.common.util.Option.get(Option.java:88)
      at org.apache.hudi.io.HoodieMergeHandle.<init>(HoodieMergeHandle.java:83)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.getUpdateHandle(BaseJavaCommitActionExecutor.java:288)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.handleUpdate(BaseJavaCommitActionExecutor.java:264)
      at org.apache.hudi.table.action.commit.BaseJavaCommitActionExecutor.handleUpsertPartition(BaseJavaCommitActionExecutor.java:238)
      ... 10 more

       

      In HoodieMergeHandle constructor code below line

      init(fileId, partitionPath, hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get());

      returns an Option and get is performed on it without safety check.

      Input file path: Local file system (mac os)

      Attachments

        Activity

          People

            Unassigned Unassigned
            arunp Arun Prasath
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: