From 7155dd314cecc8326393d07cf395b3f853733747 Mon Sep 17 00:00:00 2001 From: Kanha gupta Date: Thu, 26 Oct 2023 01:42:49 +0530 Subject: [PATCH] support for WithInsert --- .../converter/statement/insert/InsertStatementConverter.java | 5 ++++- test/it/optimizer/src/test/resources/converter/insert.xml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/insert/InsertStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/insert/InsertStatementConverter.java index 86444eb7c96dd..6d6a9dbbd0c8e 100644 --- a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/insert/InsertStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/insert/InsertStatementConverter.java @@ -28,9 +28,11 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; +import org.apache.shardingsphere.sql.parser.sql.dialect.handler.dml.InsertStatementHandler; import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ColumnConverter; import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.TableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.with.WithConverter; import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.SQLStatementConverter; import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; @@ -47,7 +49,8 @@ public final class InsertStatementConverter implements SQLStatementConverter WithConverter.convert(optional, sqlInsert)).orElse(sqlInsert); } private SqlInsert convertInsert(final InsertStatement insertStatement) { diff --git a/test/it/optimizer/src/test/resources/converter/insert.xml b/test/it/optimizer/src/test/resources/converter/insert.xml index 770669ccbfe25..a5c3d564e7902 100644 --- a/test/it/optimizer/src/test/resources/converter/insert.xml +++ b/test/it/optimizer/src/test/resources/converter/insert.xml @@ -76,4 +76,6 @@ + +