From d7549860b082478aaddb53cff9c3ff1836d88429 Mon Sep 17 00:00:00 2001 From: "jiafeng.zhang" Date: Fri, 11 Feb 2022 12:39:53 +0800 Subject: [PATCH] Solve the problem that the web UI playground preview table data, the field is the wrong problem Solve the problem that the web UI playground preview table data, the field is the wrong problem --- .../org/apache/doris/httpv2/util/StatementSubmitter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java index ae51fb8548e551..1c0b979f7e4c4f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java +++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java @@ -172,7 +172,12 @@ private ExecutionResultSet generateResultSet(ResultSet rs, long startTime) throw List row = Lists.newArrayListWithCapacity(colNum); // index start from 1 for (int i = 1; i <= colNum; ++i) { - row.add(rs.getObject(i)); + String type = rs.getMetaData().getColumnTypeName(i); + if("DATE".equalsIgnoreCase(type) || "DATETIME".equalsIgnoreCase(type)){ + row.add(rs.getString(i)); + } else { + row.add(rs.getObject(i)); + } } rows.add(row); rowCount++;