Skip to content

Commit

Permalink
[fix](stats) when some stat is NULL, causing an exception during disp…
Browse files Browse the repository at this point in the history
…lay stats (apache#21588)

During manual statistics injection, some statistics may beNULL, causing an exception during display.
  • Loading branch information
weizhengte authored Jul 12, 2023
1 parent d86c678 commit 3b76428
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ public static ColumnStatistic fromResultRow(ResultRow resultRow) {
}
String min = resultRow.getColumnValue("min");
String max = resultRow.getColumnValue("max");
if (min != null) {
if (min != null && !min.equalsIgnoreCase("NULL")) {
columnStatisticBuilder.setMinValue(StatisticsUtil.convertToDouble(col.getType(), min));
columnStatisticBuilder.setMinExpr(StatisticsUtil.readableValue(col.getType(), min));
} else {
columnStatisticBuilder.setMinValue(Double.MIN_VALUE);
}
if (max != null) {
if (max != null && !max.equalsIgnoreCase("NULL")) {
columnStatisticBuilder.setMaxValue(StatisticsUtil.convertToDouble(col.getType(), max));
columnStatisticBuilder.setMaxExpr(StatisticsUtil.readableValue(col.getType(), max));
} else {
Expand Down

0 comments on commit 3b76428

Please sign in to comment.