From d9702a5cda140e501adcbf376110b6bded40d760 Mon Sep 17 00:00:00 2001 From: LemonLiTree Date: Wed, 13 Dec 2023 17:17:15 +0800 Subject: [PATCH 1/3] fix --- .../org/apache/doris/nereids/parser/LogicalPlanBuilder.java | 3 ++- 1 file changed, 2 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 6b644bc723823f..8af29823e5de19 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 @@ -2326,7 +2326,8 @@ public ColumnDefinition visitColumnDef(ColumnDefContext ctx) { 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); From 28322198679336eb478936a803367650ed5f4cce Mon Sep 17 00:00:00 2001 From: LemonLiTree Date: Wed, 13 Dec 2023 17:37:40 +0800 Subject: [PATCH 2/3] format --- .../org/apache/doris/nereids/parser/LogicalPlanBuilder.java | 3 ++- 1 file changed, 2 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 8af29823e5de19..64d2556e0a88e7 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 @@ -2327,7 +2327,8 @@ public ColumnDefinition visitColumnDef(ColumnDefContext ctx) { } } //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("\\","") : ""; + 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); From bea6c394701f2810ee571401a83a95f90a35dd13 Mon Sep 17 00:00:00 2001 From: LemonLiTree Date: Wed, 13 Dec 2023 17:42:55 +0800 Subject: [PATCH 3/3] format --- .../org/apache/doris/nereids/parser/LogicalPlanBuilder.java | 2 +- 1 file changed, 1 insertion(+), 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 64d2556e0a88e7..30fd3dc5ce6271 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 @@ -2328,7 +2328,7 @@ public ColumnDefinition visitColumnDef(ColumnDefContext ctx) { } //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("\\", "") : ""; + .replace("\\", "") : ""; boolean isAutoInc = ctx.AUTO_INCREMENT() != null; return new ColumnDefinition(colName, colType, isKey, aggType, !isNotNull, isAutoInc, defaultValue, onUpdateDefaultValue, comment);