From d96278ab212ff122e9e5176ee1bcc9da2430d911 Mon Sep 17 00:00:00 2001 From: Liqf <109049295+LemonLiTree@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:17:20 +0800 Subject: [PATCH] [bug](fix) show create table show comment error (#28346) --- .../org/apache/doris/nereids/parser/LogicalPlanBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java index cf670fe1aa..7189051662 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java @@ -2424,7 +2424,9 @@ public class LogicalPlanBuilder extends DorisParserBaseVisitor { e.getCause()); } } - String comment = ctx.comment != null ? ctx.comment.getText() : ""; + //comment should remove '\' and '(") at the beginning and end + String comment = ctx.comment != null ? ctx.comment.getText().substring(1, ctx.comment.getText().length() - 1) + .replace("\\", "") : ""; boolean isAutoInc = ctx.AUTO_INCREMENT() != null; return new ColumnDefinition(colName, colType, isKey, aggType, !isNotNull, isAutoInc, defaultValue, onUpdateDefaultValue, comment);