From 4633f9dce19ef8031ca14d03f201917874a49a19 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Thu, 21 Nov 2024 16:21:12 +0800 Subject: [PATCH] Refactor KernelDistSQLStatementVisitor (#33756) * Refactor usage of VariableSegment * Refactor KernelDistSQLStatementVisitor --- .../parser/core/kernel/KernelDistSQLStatementVisitor.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java b/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java index 52f1886e1a472..f242c4b010068 100644 --- a/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java +++ b/parser/distsql/engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/kernel/KernelDistSQLStatementVisitor.java @@ -305,7 +305,7 @@ public ASTNode visitImportDatabaseConfiguration(final ImportDatabaseConfiguratio @Override public ASTNode visitImportMetaData(final ImportMetaDataContext ctx) { - return new ImportMetaDataStatement(null == ctx.metaDataValue() ? null : getQuotedContent(ctx.metaDataValue()), getIdentifierValue(ctx.filePath())); + return new ImportMetaDataStatement(null == ctx.metaDataValue() ? null : QuoteCharacter.unwrapText(ctx.metaDataValue().getText()), getIdentifierValue(ctx.filePath())); } @Override @@ -338,10 +338,6 @@ private String getIdentifierValue(final ParseTree context) { return null == context ? null : new IdentifierValue(context.getText()).getValue(); } - private String getQuotedContent(final ParseTree context) { - return IdentifierValue.getQuotedContent(context.getText()); - } - @Override public ASTNode visitShowPluginImplementations(final ShowPluginImplementationsContext ctx) { return new ShowPluginsStatement("COMMON", getIdentifierValue(ctx.pluginClass()));