This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch show-pipes-npe
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 5cb596f37adf0a06b127c9734b6522442e71b170
Author: Steve Yurong Su <[email protected]>
AuthorDate: Wed Jul 31 17:03:06 2024 +0800

    Update PipeParameters.java
---
 .../api/customizer/parameter/PipeParameters.java   | 25 +++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git 
a/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java
 
b/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java
index 1190054c6e9..1646423b133 100644
--- 
a/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java
+++ 
b/iotdb-api/pipe-api/src/main/java/org/apache/iotdb/pipe/api/customizer/parameter/PipeParameters.java
@@ -278,13 +278,32 @@ public class PipeParameters {
         .collect(
             Collectors.toMap(
                 Entry::getKey,
-                entry -> ValueHider.hide(entry.getKey(), entry.getValue()),
-                // The key won't be duplicated thus we just return the oldValue
-                (u, v) -> u,
+                entry -> {
+                  final String value = ValueHider.hide(entry.getKey(), 
entry.getValue());
+                  return value == null ? "null" : value;
+                },
+                (v1, v2) -> {
+                  final boolean v1IsNull = isNullValue(v1);
+                  final boolean v2IsNull = isNullValue(v2);
+                  if (v1IsNull && v2IsNull) {
+                    return "null";
+                  }
+                  if (v1IsNull) {
+                    return v2;
+                  }
+                  if (v2IsNull) {
+                    return v1;
+                  }
+                  return v1;
+                },
                 TreeMap::new))
         .toString();
   }
 
+  private static boolean isNullValue(final String value) {
+    return value == null || value.equals("null");
+  }
+
   /**
    * This method adds (non-existed) or replaces (existed) equivalent 
attributes in this
    * PipeParameters with those from another PipeParameters.

Reply via email to