diff --git a/service-executor/service-executor-task/src/main/java/com/lanyuanxiaoyao/service/executor/task/SQLExecutor.java b/service-executor/service-executor-task/src/main/java/com/lanyuanxiaoyao/service/executor/task/SQLExecutor.java index 5a8d309..4545fdd 100644 --- a/service-executor/service-executor-task/src/main/java/com/lanyuanxiaoyao/service/executor/task/SQLExecutor.java +++ b/service-executor/service-executor-task/src/main/java/com/lanyuanxiaoyao/service/executor/task/SQLExecutor.java @@ -1,6 +1,7 @@ package com.lanyuanxiaoyao.service.executor.task; import cn.hutool.core.collection.IterUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import de.vandermeer.asciitable.AsciiTable; import de.vandermeer.asciitable.CWC_LongestLine; @@ -18,7 +19,6 @@ import org.apache.flink.util.CloseableIterator; import org.apache.hudi.common.table.HoodieTableConfig; import org.apache.hudi.common.table.HoodieTableMetaClient; import org.apache.hudi.common.table.TableSchemaResolver; -import org.apache.hudi.configuration.FlinkOptions; import org.apache.hudi.org.apache.avro.Schema; import org.apache.hudi.util.AvroSchemaConverter; import org.apache.hudi.util.HoodiePipeline; @@ -89,7 +89,12 @@ public class SQLExecutor { table.addRule(); table.addRow(fields.toArray()); table.addRule(); - iterator.forEachRemaining(row -> table.addRow(fields.collect(row::getField).toArray())); + iterator.forEachRemaining(row -> { + table.addRow(fields.collect(name -> { + Object field = row.getField(name); + return ObjectUtil.isNull(field) ? "null" : field; + }).toArray()); + }); table.addRule(); table.getRenderer().setCWC(new CWC_LongestLine()); table.getContext().setGridTheme(TA_GridThemes.NONE);