You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by co...@apache.org on 2022/10/17 15:32:54 UTC
[hudi] branch master updated: [MINOR] Handling null event time (#6876)
This is an automated email from the ASF dual-hosted git repository.
codope pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 7bf82936f0 [MINOR] Handling null event time (#6876)
7bf82936f0 is described below
commit 7bf82936f0b9637f7aaf06d3b70c46561cd40d3d
Author: Sivabalan Narayanan <n....@gmail.com>
AuthorDate: Mon Oct 17 08:32:16 2022 -0700
[MINOR] Handling null event time (#6876)
---
.../src/main/java/org/apache/hudi/client/WriteStatus.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/WriteStatus.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/WriteStatus.java
index 8f74858669..b306d6c540 100644
--- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/WriteStatus.java
+++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/WriteStatus.java
@@ -25,6 +25,7 @@ import org.apache.hudi.common.model.HoodieRecord;
import org.apache.hudi.common.model.HoodieWriteStat;
import org.apache.hudi.common.util.DateTimeUtils;
import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.StringUtils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
@@ -99,9 +100,11 @@ public class WriteStatus implements Serializable {
if (optionalRecordMetadata.isPresent()) {
String eventTimeVal = optionalRecordMetadata.get().getOrDefault(METADATA_EVENT_TIME_KEY, null);
try {
- long eventTime = DateTimeUtils.parseDateTime(eventTimeVal).toEpochMilli();
- stat.setMinEventTime(eventTime);
- stat.setMaxEventTime(eventTime);
+ if (!StringUtils.isNullOrEmpty(eventTimeVal)) {
+ long eventTime = DateTimeUtils.parseDateTime(eventTimeVal).toEpochMilli();
+ stat.setMinEventTime(eventTime);
+ stat.setMaxEventTime(eventTime);
+ }
} catch (DateTimeException | IllegalArgumentException e) {
LOG.debug(String.format("Fail to parse event time value: %s", eventTimeVal), e);
}