homatthew commented on code in PR #3949:
URL: https://github.com/apache/gobblin/pull/3949#discussion_r1600771410
##########
gobblin-iceberg/src/main/java/org/apache/gobblin/iceberg/publisher/GobblinMCEPublisher.java:
##########
@@ -115,9 +115,11 @@ public void publishData(Collection<? extends
WorkUnitState> states) throws IOExc
}
protected Map<String, String> getPartitionOffsetRange(String offsetKey) {
- return state.getPropAsList(offsetKey)
Review Comment:
A common idiomatic way of handling this nullable case is
```
Optional.ofNullable(...)
.orElseGet(Collections::emptyList)
.stream()
```
##########
gobblin-iceberg/src/main/java/org/apache/gobblin/iceberg/publisher/GobblinMCEPublisher.java:
##########
@@ -115,9 +115,11 @@ public void publishData(Collection<? extends
WorkUnitState> states) throws IOExc
}
protected Map<String, String> getPartitionOffsetRange(String offsetKey) {
- return state.getPropAsList(offsetKey)
Review Comment:
Fun Fact: A common idiomatic way of handling this nullable case is
```
Optional.ofNullable(...)
.orElseGet(Collections::emptyList)
.stream()
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]