From 3e1ad2519524f74a1f7ce42903b51bf02612091c Mon Sep 17 00:00:00 2001 From: JibingLi Date: Mon, 21 Mar 2022 15:40:45 +0800 Subject: [PATCH] Replace null with empty String in master proxy result set. This is to fix NPE when the master proxy result set contains a null item. The NPE could cause the thrift server crash and failed to send the result back to the client which is a follower or observer fe. --- .../src/main/java/org/apache/doris/qe/ShowResultSet.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ShowResultSet.java b/fe/fe-core/src/main/java/org/apache/doris/qe/ShowResultSet.java index a2c852d5358a70..f19e8980d09fba 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/ShowResultSet.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ShowResultSet.java @@ -21,6 +21,7 @@ import org.apache.doris.catalog.Column; import org.apache.doris.catalog.PrimitiveType; import org.apache.doris.catalog.ScalarType; +import org.apache.doris.common.FeConstants; import org.apache.doris.thrift.TColumnDefinition; import org.apache.doris.thrift.TShowResultSet; import org.apache.doris.thrift.TShowResultSetMetaData; @@ -65,7 +66,7 @@ public TShowResultSet tothrift() { for (int i = 0; i < resultRows.size(); i ++) { ArrayList list = Lists.newArrayList(); for (int j = 0; j < resultRows.get(i).size(); j ++) { - list.add(resultRows.get(i).get(j)); + list.add(resultRows.get(i).get(j) == null ? FeConstants.null_string : resultRows.get(i).get(j)); } set.resultRows.add(list); }