Skip to content

Commit 2d26f9d

Browse files
committed
[core] fix
1 parent 7cb026d commit 2d26f9d

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

paimon-common/src/main/java/org/apache/paimon/CoreOptions.java

+8-12
Original file line numberDiff line numberDiff line change
@@ -2272,17 +2272,13 @@ public boolean writeOnly() {
22722272
}
22732273

22742274
public Set<WriteAction> writeActions() {
2275-
return options.getOptional(WRITE_ACTIONS)
2276-
.map(
2277-
str ->
2278-
Arrays.stream(str.split(","))
2279-
.map(
2280-
action ->
2281-
WriteAction.valueOf(
2282-
action.toUpperCase()
2283-
.replace('-', '_')))
2284-
.collect(Collectors.toCollection(HashSet::new)))
2285-
.orElseGet(() -> new HashSet<>(0));
2275+
String str = options.get(WRITE_ACTIONS);
2276+
if (StringUtils.isNullOrWhitespaceOnly(str)) {
2277+
return new HashSet<>(0);
2278+
}
2279+
return Arrays.stream(str.split(","))
2280+
.map(action -> WriteAction.valueOf(action.toUpperCase().replace('-', '_')))
2281+
.collect(Collectors.toCollection(HashSet::new));
22862282
}
22872283

22882284
public boolean doPartitionExpireAction(Set<WriteAction> doWriteActions) {
@@ -2321,7 +2317,7 @@ public boolean doCompact() {
23212317
}
23222318

23232319
public boolean doAllWriteActions(Set<WriteAction> doWriteActions) {
2324-
return doWriteActions.contains(WriteAction.ALL);
2320+
return doWriteActions.isEmpty() || doWriteActions.contains(WriteAction.ALL);
23252321
}
23262322

23272323
public boolean streamingReadOverwrite() {

0 commit comments

Comments
 (0)