You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2024/06/24 07:37:54 UTC
(shardingsphere) branch master updated: fix doris json table get text miss spaces. Although the current version does not support the json_table function. (#31826)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9ec2c34d76f fix doris json table get text miss spaces. Although the current version does not support the json_table function. (#31826)
9ec2c34d76f is described below
commit 9ec2c34d76f5b06ce256f36b9801785197da6063
Author: yydeng626 <yy...@gmail.com>
AuthorDate: Mon Jun 24 15:37:47 2024 +0800
fix doris json table get text miss spaces. Although the current version does not support the json_table function. (#31826)
---
.../sql/parser/doris/visitor/statement/DorisStatementVisitor.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/parser/sql/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/doris/visitor/statement/DorisStatementVisitor.java b/parser/sql/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/doris/visitor/statement/DorisStatementVisitor.java
index 1640c7d4d02..2652d7bf15c 100644
--- a/parser/sql/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/doris/visitor/statement/DorisStatementVisitor.java
+++ b/parser/sql/dialect/doris/src/main/java/org/apache/shardingsphere/sql/parser/doris/visitor/statement/DorisStatementVisitor.java
@@ -949,10 +949,11 @@ public abstract class DorisStatementVisitor extends DorisStatementBaseVisitor<AS
@Override
public final ASTNode visitJsonTableFunction(final JsonTableFunctionContext ctx) {
- FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.JSON_TABLE().getText(), ctx.getText());
+ FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.JSON_TABLE().getText(), getOriginalText(ctx));
result.getParameters().add((ExpressionSegment) visit(ctx.expr()));
- result.getParameters().add(new LiteralExpressionSegment(ctx.path().getStart().getStartIndex(), ctx.path().getStop().getStopIndex(), ctx.path().getText()));
- result.getParameters().add(new LiteralExpressionSegment(ctx.jsonTableColumns().getStart().getStartIndex(), ctx.jsonTableColumns().getStop().getStopIndex(), ctx.jsonTableColumns().getText()));
+ result.getParameters().add(new LiteralExpressionSegment(ctx.path().getStart().getStartIndex(), ctx.path().getStop().getStopIndex(), getOriginalText(ctx.path())));
+ result.getParameters().add(new LiteralExpressionSegment(ctx.jsonTableColumns().getStart().getStartIndex(), ctx.jsonTableColumns().getStop().getStopIndex(),
+ getOriginalText(ctx.jsonTableColumns())));
return result;
}