[ https://issues.apache.org/jira/browse/HUDI-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hong Shen updated HUDI-1005: ---------------------------- Status: Open (was: New) > NPE in HoodieWriteClient.clean > ------------------------------- > > Key: HUDI-1005 > URL: https://issues.apache.org/jira/browse/HUDI-1005 > Project: Apache Hudi > Issue Type: Bug > Components: Writer Core > Reporter: Hong Shen > Assignee: Hong Shen > Priority: Major > Labels: pull-request-available > > HoodieWriteClient.clean will throw NullPointerException, here is the error > message. > {code} > Caused by: java.lang.NullPointerException > at > org.apache.hudi.client.HoodieWriteClient.clean(HoodieWriteClient.java:495) > at > org.apache.hudi.client.HoodieWriteClient.postCommit(HoodieWriteClient.java:344) > at > org.apache.hudi.client.AbstractHoodieWriteClient.commit(AbstractHoodieWriteClient.java:123) > at > org.apache.hudi.client.AbstractHoodieWriteClient.commit(AbstractHoodieWriteClient.java:94) > at > org.apache.hudi.utilities.deltastreamer.DeltaSync.writeToSink(DeltaSync.java:399) > at > org.apache.hudi.utilities.deltastreamer.DeltaSync.syncOnce(DeltaSync.java:232) > at > org.apache.hudi.utilities.deltastreamer.HoodieDeltaStreamer$DeltaSyncService.lambda$startService$0(HoodieDeltaStreamer.java:422) > ... 5 more > {code} > When metrics is on HoodieCleanMetadata metadata is null, it will throw NPE. > {code} > public HoodieCleanMetadata clean(String cleanInstantTime) throws > HoodieIOException { > LOG.info("Cleaner started"); > final Timer.Context context = metrics.getCleanCtx(); > HoodieCleanMetadata metadata = HoodieTable.create(config, > hadoopConf).clean(jsc, cleanInstantTime); > if (context != null) { > long durationMs = metrics.getDurationInMs(context.stop()); > metrics.updateCleanMetrics(durationMs, metadata.getTotalFilesDeleted()); > LOG.info("Cleaned " + metadata.getTotalFilesDeleted() + " files" > + " Earliest Retained Instant :" + > metadata.getEarliestCommitToRetain() > + " cleanerElaspsedMs" + durationMs); > } > return metadata; > } > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)