You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by yu...@apache.org on 2022/09/29 01:42:44 UTC
[hudi] 03/17: [HUDI-4918] Fix bugs about when trying to show the non -existing key from env, NullPointException occurs. (#6794)
This is an automated email from the ASF dual-hosted git repository.
yuzhaojing pushed a commit to branch release-0.12.1-rc1
in repository https://gitbox.apache.org/repos/asf/hudi.git
commit 66851012627d3266c66a003c37308b7c6861689e
Author: Forus <70...@users.noreply.github.com>
AuthorDate: Mon Sep 26 22:05:34 2022 +0800
[HUDI-4918] Fix bugs about when trying to show the non -existing key from env, NullPointException occurs. (#6794)
---
.../src/main/java/org/apache/hudi/cli/commands/SparkEnvCommand.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hudi-cli/src/main/java/org/apache/hudi/cli/commands/SparkEnvCommand.java b/hudi-cli/src/main/java/org/apache/hudi/cli/commands/SparkEnvCommand.java
index 5c21fe43e1..02778ac2cf 100644
--- a/hudi-cli/src/main/java/org/apache/hudi/cli/commands/SparkEnvCommand.java
+++ b/hudi-cli/src/main/java/org/apache/hudi/cli/commands/SparkEnvCommand.java
@@ -60,7 +60,7 @@ public class SparkEnvCommand {
if (key == null || key.isEmpty()) {
return showAllEnv();
} else {
- return HoodiePrintHelper.print(new String[] {"key", "value"}, new String[][] {new String[] {key, env.get(key)}});
+ return HoodiePrintHelper.print(new String[] {"key", "value"}, new String[][] {new String[] {key, env.getOrDefault(key, "")}});
}
}
}