From 32fa879a9664d6ef32aed5de0b4f86cef2cf692b Mon Sep 17 00:00:00 2001 From: Zhengqiang Duan Date: Fri, 20 Oct 2023 12:33:10 +0800 Subject: [PATCH] Move some segment to dialect package and rename ColumnWithJoinOperatorSegment to OuterJoinExpression (#28813) --- .../expression/ExpressionConverter.java | 2 +- .../impl/MatchExpressionConverter.java | 2 +- .../statement/MySQLStatementVisitor.java | 2 +- .../statement/OracleStatementVisitor.java | 30 +++++++++---------- .../type/OracleDMLStatementVisitor.java | 26 ++++++++-------- .../item/IntervalExpressionProjection.java | 4 +-- .../sql/common/util/ColumnExtractor.java | 10 +++---- .../handler/dml/InsertStatementHandler.java | 6 ++-- .../mysql/match}/MatchAgainstExpression.java | 3 +- .../oracle/datetime}/DatetimeExpression.java | 4 +-- .../IntervalDayToSecondExpression.java | 5 ++-- .../IntervalYearToMonthExpression.java | 3 +- .../oracle/join/OuterJoinExpression.java} | 6 ++-- .../oracle/multiset}/MultisetExpression.java | 8 +++-- .../MultiTableConditionalIntoElseSegment.java | 2 +- .../MultiTableConditionalIntoSegment.java | 2 +- .../MultiTableConditionalIntoThenSegment.java | 2 +- ...tiTableConditionalIntoWhenThenSegment.java | 2 +- .../MultiTableInsertIntoSegment.java | 2 +- .../MultiTableInsertType.java | 2 +- .../xml}/XmlElementFunctionSegment.java | 5 ++-- ...XmlNameSpaceStringAsIdentifierSegment.java | 2 +- .../xml}/XmlNameSpacesClauseSegment.java | 2 +- .../oracle/xml}/XmlPiFunctionSegment.java | 3 +- .../XmlQueryAndExistsFunctionSegment.java | 3 +- .../xml}/XmlSerializeFunctionSegment.java | 3 +- .../oracle/xml}/XmlTableColumnSegment.java | 3 +- .../oracle/xml}/XmlTableFunctionSegment.java | 2 +- .../oracle/xml}/XmlTableOptionsSegment.java | 3 +- .../oracle/dml/OracleInsertStatement.java | 6 ++-- .../dml/InsertStatementHandlerTest.java | 2 +- .../test/resources/converter/select-join.xml | 1 + ...rt.java => OuterJoinExpressionAssert.java} | 16 +++++----- .../segment/expression/ExpressionAssert.java | 16 +++++----- ...MultiTableConditionalIntoClauseAssert.java | 4 +-- ...TableConditionalIntoElseSegmentAssert.java | 2 +- ...TableConditionalIntoThenSegmentAssert.java | 2 +- .../MultiTableInsertIntoClauseAssert.java | 2 +- .../asserts/segment/table/TableAssert.java | 2 +- .../dml/impl/InsertStatementAssert.java | 6 ++-- .../segment/impl/expr/ExpectedExpression.java | 4 +-- ....java => ExpectedOuterJoinExpression.java} | 4 +-- .../main/resources/case/ddl/create-view.xml | 8 ++--- .../main/resources/case/dml/select-join.xml | 4 +-- 44 files changed, 121 insertions(+), 107 deletions(-) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/mysql/match}/MatchAgainstExpression.java (89%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/datetime}/DatetimeExpression.java (91%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/interval}/IntervalDayToSecondExpression.java (86%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/interval}/IntervalYearToMonthExpression.java (88%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr/simple/ColumnWithJoinOperatorSegment.java => dialect/segment/oracle/join/OuterJoinExpression.java} (87%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/multiset}/MultisetExpression.java (81%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/{insert => table}/MultiTableConditionalIntoElseSegment.java (98%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/{insert => table}/MultiTableConditionalIntoSegment.java (99%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/{insert => table}/MultiTableConditionalIntoThenSegment.java (98%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/{insert => table}/MultiTableConditionalIntoWhenThenSegment.java (98%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/{insert => table}/MultiTableInsertIntoSegment.java (98%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/{insert => table}/MultiTableInsertType.java (98%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlElementFunctionSegment.java (86%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlNameSpaceStringAsIdentifierSegment.java (94%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlNameSpacesClauseSegment.java (94%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlPiFunctionSegment.java (93%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlQueryAndExistsFunctionSegment.java (90%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlSerializeFunctionSegment.java (90%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlTableColumnSegment.java (89%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlTableFunctionSegment.java (95%) rename parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/{common/segment/dml/expr => dialect/segment/oracle/xml}/XmlTableOptionsSegment.java (89%) rename test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/column/{ColumnWithJoinOperatorAssert.java => OuterJoinExpressionAssert.java} (72%) rename test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/{ExpectedColumnWithJoinOperatorSegment.java => ExpectedOuterJoinExpression.java} (88%) diff --git a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/ExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/ExpressionConverter.java index 883bc1aad84f0..b8eee602bbeef 100644 --- a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/ExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/ExpressionConverter.java @@ -33,7 +33,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ListExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MatchAgainstExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.mysql.match.MatchAgainstExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.RowExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.TypeCastExpression; diff --git a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/MatchExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/MatchExpressionConverter.java index a01197c258839..d1e6e4953018d 100644 --- a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/MatchExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/MatchExpressionConverter.java @@ -24,7 +24,7 @@ import org.apache.calcite.sql.SqlLiteral; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MatchAgainstExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.mysql.match.MatchAgainstExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OwnerSegment; import org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql.SQLExtensionOperatorTable; import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; diff --git a/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java b/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java index 912645c8a7795..9789712de3707 100644 --- a/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java +++ b/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/MySQLStatementVisitor.java @@ -175,7 +175,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ListExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MatchAgainstExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.mysql.match.MatchAgainstExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.RowExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.UnaryOperationExpression; diff --git a/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java b/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java index 90d53ad7bcbc4..915d2a392c1de 100644 --- a/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java +++ b/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/OracleStatementVisitor.java @@ -116,26 +116,26 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BetweenExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CaseWhenExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.DatetimeExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.datetime.DatetimeExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.IntervalDayToSecondExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.IntervalYearToMonthExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval.IntervalDayToSecondExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval.IntervalYearToMonthExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ListExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MultisetExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.multiset.MultisetExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlElementFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlNameSpaceStringAsIdentifierSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlNameSpacesClauseSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlPiFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlQueryAndExistsFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlSerializeFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlTableColumnSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlTableFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlTableOptionsSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlElementFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlNameSpaceStringAsIdentifierSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlNameSpacesClauseSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlPiFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlQueryAndExistsFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlSerializeFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlTableColumnSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlTableFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlTableOptionsSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ColumnWithJoinOperatorSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.join.OuterJoinExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubqueryExpressionSegment; @@ -577,7 +577,7 @@ public final ASTNode visitSimpleExpr(final SimpleExprContext ctx) { } if (null != ctx.columnName()) { return null == ctx.joinOperator() ? visit(ctx.columnName()) - : new ColumnWithJoinOperatorSegment(startIndex, stopIndex, (ColumnSegment) visitColumnName(ctx.columnName()), ctx.joinOperator().getText()); + : new OuterJoinExpression(startIndex, stopIndex, (ColumnSegment) visitColumnName(ctx.columnName()), ctx.joinOperator().getText()); } if (null != ctx.privateExprOfDb()) { return visit(ctx.privateExprOfDb()); diff --git a/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java b/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java index e8fa6f0355225..18a08899175ce 100644 --- a/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java +++ b/parser/sql/dialect/oracle/src/main/java/org/apache/shardingsphere/sql/parser/oracle/visitor/statement/type/OracleDMLStatementVisitor.java @@ -121,17 +121,17 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CaseWhenExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CollateExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.DatetimeExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.datetime.DatetimeExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionWithParamsSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MultisetExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlElementFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlPiFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlQueryAndExistsFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlSerializeFunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlTableFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.multiset.MultisetExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlElementFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlPiFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlQueryAndExistsFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlSerializeFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlTableFunctionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonTableExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; @@ -174,12 +174,12 @@ import org.apache.shardingsphere.sql.parser.sql.common.value.collection.CollectionValue; import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue; import org.apache.shardingsphere.sql.parser.sql.common.value.literal.impl.BooleanLiteralValue; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoElseSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoThenSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoWhenThenSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertType; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoElseSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoThenSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoWhenThenSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertType; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.dml.OracleDeleteStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.dml.OracleInsertStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.dml.OracleLockTableStatement; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/IntervalExpressionProjection.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/IntervalExpressionProjection.java index c1845736c4107..543d41ddfab04 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/IntervalExpressionProjection.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/item/IntervalExpressionProjection.java @@ -21,8 +21,8 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.IntervalDayToSecondExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.IntervalYearToMonthExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval.IntervalDayToSecondExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval.IntervalYearToMonthExpression; /** * Between expression. diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractor.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractor.java index b4be86f36c670..c3c6f68f66597 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractor.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractor.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ColumnWithJoinOperatorSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.join.OuterJoinExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.AndPredicate; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment; @@ -52,11 +52,11 @@ public static Collection extract(final ExpressionSegment expressi if (((BinaryOperationExpression) expression).getRight() instanceof ColumnSegment) { result.add((ColumnSegment) ((BinaryOperationExpression) expression).getRight()); } - if (((BinaryOperationExpression) expression).getLeft() instanceof ColumnWithJoinOperatorSegment) { - result.add(((ColumnWithJoinOperatorSegment) ((BinaryOperationExpression) expression).getLeft()).getColumnName()); + if (((BinaryOperationExpression) expression).getLeft() instanceof OuterJoinExpression) { + result.add(((OuterJoinExpression) ((BinaryOperationExpression) expression).getLeft()).getColumnName()); } - if (((BinaryOperationExpression) expression).getRight() instanceof ColumnWithJoinOperatorSegment) { - result.add(((ColumnWithJoinOperatorSegment) ((BinaryOperationExpression) expression).getRight()).getColumnName()); + if (((BinaryOperationExpression) expression).getRight() instanceof OuterJoinExpression) { + result.add(((OuterJoinExpression) ((BinaryOperationExpression) expression).getRight()).getColumnName()); } } if (expression instanceof InExpression && ((InExpression) expression).getLeft() instanceof ColumnSegment) { diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandler.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandler.java index 38f054b30b9ca..65bcfbe39bf46 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandler.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandler.java @@ -27,9 +27,9 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.WithSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.SQLStatementHandler; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertType; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertType; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dml.MySQLInsertStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.dml.OpenGaussInsertStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.dml.OracleInsertStatement; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/MatchAgainstExpression.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/mysql/match/MatchAgainstExpression.java similarity index 89% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/MatchAgainstExpression.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/mysql/match/MatchAgainstExpression.java index d4de7f89b8067..6c14c50a8c6c1 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/MatchAgainstExpression.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/mysql/match/MatchAgainstExpression.java @@ -15,12 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.mysql.match; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; /** * Match against expression. diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/DatetimeExpression.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/datetime/DatetimeExpression.java similarity index 91% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/DatetimeExpression.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/datetime/DatetimeExpression.java index cfd209dd414e8..b0fecc81e690c 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/DatetimeExpression.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/datetime/DatetimeExpression.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.datetime; import lombok.Getter; import lombok.Setter; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; /** * Datetime expression. */ - @Getter @Setter public final class DatetimeExpression implements ExpressionSegment { diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/IntervalDayToSecondExpression.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/interval/IntervalDayToSecondExpression.java similarity index 86% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/IntervalDayToSecondExpression.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/interval/IntervalDayToSecondExpression.java index dd972002ef506..94d64de48ec16 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/IntervalDayToSecondExpression.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/interval/IntervalDayToSecondExpression.java @@ -15,14 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; /** - * Between expression. + * Interval day to second expression. */ @RequiredArgsConstructor @Getter diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/IntervalYearToMonthExpression.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/interval/IntervalYearToMonthExpression.java similarity index 88% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/IntervalYearToMonthExpression.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/interval/IntervalYearToMonthExpression.java index a7e22d53f52e0..3d1b27a0d06e2 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/IntervalYearToMonthExpression.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/interval/IntervalYearToMonthExpression.java @@ -15,11 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; /** * Interval year to month expression. diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/simple/ColumnWithJoinOperatorSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/join/OuterJoinExpression.java similarity index 87% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/simple/ColumnWithJoinOperatorSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/join/OuterJoinExpression.java index 66e8be1f1b155..fb28bcb9eecd6 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/simple/ColumnWithJoinOperatorSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/join/OuterJoinExpression.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.join; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -23,11 +23,11 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; /** - * Column with join operator segment. + * Outer join expression. */ @RequiredArgsConstructor @Getter -public class ColumnWithJoinOperatorSegment implements ExpressionSegment { +public class OuterJoinExpression implements ExpressionSegment { private final int startIndex; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/MultisetExpression.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/multiset/MultisetExpression.java similarity index 81% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/MultisetExpression.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/multiset/MultisetExpression.java index 6bdab9f8030ac..d5697414c3496 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/MultisetExpression.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/multiset/MultisetExpression.java @@ -15,16 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.multiset; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; +/** + * Multiset expression. + */ @RequiredArgsConstructor @Getter @Setter -public class MultisetExpression implements ExpressionSegment { +public final class MultisetExpression implements ExpressionSegment { private final int startIndex; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoElseSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoElseSegment.java similarity index 98% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoElseSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoElseSegment.java index b915e47705976..3b34fa0155d2e 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoElseSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoElseSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoSegment.java similarity index 99% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoSegment.java index 23b7ef19c8a1c..184f8eeec35fe 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoThenSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoThenSegment.java similarity index 98% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoThenSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoThenSegment.java index f324f66e0a5ce..1d7242a52d386 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoThenSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoThenSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoWhenThenSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoWhenThenSegment.java similarity index 98% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoWhenThenSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoWhenThenSegment.java index 58c573aa1896e..181fb6c25de66 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableConditionalIntoWhenThenSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableConditionalIntoWhenThenSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableInsertIntoSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableInsertIntoSegment.java similarity index 98% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableInsertIntoSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableInsertIntoSegment.java index 5cd63f71a05d2..8eea754c2e017 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableInsertIntoSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableInsertIntoSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableInsertType.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableInsertType.java similarity index 98% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableInsertType.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableInsertType.java index edc20f4947f9a..10906bb96e1b4 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/insert/MultiTableInsertType.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/table/MultiTableInsertType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table; /** * Multi table insert type. diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlElementFunctionSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlElementFunctionSegment.java similarity index 86% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlElementFunctionSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlElementFunctionSegment.java index ae5b214af894f..b448bc960d132 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlElementFunctionSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlElementFunctionSegment.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment; import org.apache.shardingsphere.sql.parser.sql.common.value.identifier.IdentifierValue; @@ -31,7 +32,7 @@ */ @RequiredArgsConstructor @Getter -public class XmlElementFunctionSegment implements ComplexExpressionSegment, ProjectionSegment { +public final class XmlElementFunctionSegment implements ComplexExpressionSegment, ProjectionSegment { private final int startIndex; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlNameSpaceStringAsIdentifierSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlNameSpaceStringAsIdentifierSegment.java similarity index 94% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlNameSpaceStringAsIdentifierSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlNameSpaceStringAsIdentifierSegment.java index 9c129d69c52f0..75eac47e6b49d 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlNameSpaceStringAsIdentifierSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlNameSpaceStringAsIdentifierSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlNameSpacesClauseSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlNameSpacesClauseSegment.java similarity index 94% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlNameSpacesClauseSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlNameSpacesClauseSegment.java index 045b3fe025695..b7f8e17bf8155 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlNameSpacesClauseSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlNameSpacesClauseSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlPiFunctionSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlPiFunctionSegment.java similarity index 93% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlPiFunctionSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlPiFunctionSegment.java index e56f77064dc91..5e476d187b6f1 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlPiFunctionSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlPiFunctionSegment.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.Setter; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlQueryAndExistsFunctionSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlQueryAndExistsFunctionSegment.java similarity index 90% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlQueryAndExistsFunctionSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlQueryAndExistsFunctionSegment.java index 2e2905f6d81ca..0097ea9ded3ef 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlQueryAndExistsFunctionSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlQueryAndExistsFunctionSegment.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlSerializeFunctionSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlSerializeFunctionSegment.java similarity index 90% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlSerializeFunctionSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlSerializeFunctionSegment.java index 1138a0eb5daf8..243167f1908f5 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlSerializeFunctionSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlSerializeFunctionSegment.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableColumnSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableColumnSegment.java similarity index 89% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableColumnSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableColumnSegment.java index 7439162a1cd92..53f26486cdd66 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableColumnSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableColumnSegment.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; /** diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableFunctionSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableFunctionSegment.java similarity index 95% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableFunctionSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableFunctionSegment.java index 6342393fc2200..d3d8c4a76d2d1 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableFunctionSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableFunctionSegment.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableOptionsSegment.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableOptionsSegment.java similarity index 89% rename from parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableOptionsSegment.java rename to parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableOptionsSegment.java index 6bdb4435a3f5c..1cdfbcee9d08b 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/dml/expr/XmlTableOptionsSegment.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/segment/oracle/xml/XmlTableOptionsSegment.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr; +package org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; import java.util.Collection; diff --git a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/dml/OracleInsertStatement.java b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/dml/OracleInsertStatement.java index 8c21e4b5f009c..84b4be08fd28b 100644 --- a/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/dml/OracleInsertStatement.java +++ b/parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/oracle/dml/OracleInsertStatement.java @@ -21,9 +21,9 @@ import lombok.Setter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertType; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertType; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.oracle.OracleStatement; import java.util.Optional; diff --git a/parser/sql/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandlerTest.java b/parser/sql/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandlerTest.java index 83b9afc49ca51..bd539619bcbc8 100644 --- a/parser/sql/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandlerTest.java +++ b/parser/sql/statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/dialect/handler/dml/InsertStatementHandlerTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.SetAssignmentSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.OnDuplicateKeyColumnsSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertIntoSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OutputSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.WithSegment; import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dml.MySQLInsertStatement; diff --git a/test/it/optimizer/src/test/resources/converter/select-join.xml b/test/it/optimizer/src/test/resources/converter/select-join.xml index 8aec090d367ad..704b5f40dcc02 100644 --- a/test/it/optimizer/src/test/resources/converter/select-join.xml +++ b/test/it/optimizer/src/test/resources/converter/select-join.xml @@ -45,4 +45,5 @@ + diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/column/ColumnWithJoinOperatorAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/column/OuterJoinExpressionAssert.java similarity index 72% rename from test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/column/ColumnWithJoinOperatorAssert.java rename to test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/column/OuterJoinExpressionAssert.java index 2223ae143b5c2..738487de9d9ee 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/column/ColumnWithJoinOperatorAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/column/OuterJoinExpressionAssert.java @@ -19,28 +19,28 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ColumnWithJoinOperatorSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.join.OuterJoinExpression; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext; -import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.expr.ExpectedColumnWithJoinOperatorSegment; +import org.apache.shardingsphere.test.it.sql.parser.internal.cases.parser.jaxb.segment.impl.expr.ExpectedOuterJoinExpression; import static org.junit.jupiter.api.Assertions.assertEquals; /** - * Column with join operator assert. + * Outer join expression assert. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ColumnWithJoinOperatorAssert { +public final class OuterJoinExpressionAssert { /** - * Assert actual column segment is correct with expected column. + * Assert actual outer join expression is correct with expected outer join expression. * * @param assertContext assert context - * @param actual actual column with join operator segment - * @param expected expected column with join operator segment + * @param actual actual outer join expression + * @param expected expected outer join expression */ - public static void assertIs(final SQLCaseAssertContext assertContext, final ColumnWithJoinOperatorSegment actual, final ExpectedColumnWithJoinOperatorSegment expected) { + public static void assertIs(final SQLCaseAssertContext assertContext, final OuterJoinExpression actual, final ExpectedOuterJoinExpression expected) { ColumnAssert.assertIs(assertContext, actual.getColumnName(), expected.getColumn()); assertEquals(actual.getJoinOperator(), expected.getJoinOperator()); } diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/expression/ExpressionAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/expression/ExpressionAssert.java index 9c7e5d72deee2..a202de5d4cd81 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/expression/ExpressionAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/expression/ExpressionAssert.java @@ -30,18 +30,18 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExtractArgExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.IntervalDayToSecondExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.IntervalYearToMonthExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval.IntervalDayToSecondExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.interval.IntervalYearToMonthExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ListExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MatchAgainstExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MultisetExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.mysql.match.MatchAgainstExpression; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.multiset.MultisetExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.TypeCastExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.UnaryOperationExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ValuesExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ColumnWithJoinOperatorSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.join.OuterJoinExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubqueryExpressionSegment; @@ -54,7 +54,7 @@ import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.column.ColumnAssert; -import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.column.ColumnWithJoinOperatorAssert; +import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.column.OuterJoinExpressionAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.generic.DataTypeAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.insert.InsertValuesClauseAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.owner.OwnerAssert; @@ -622,8 +622,8 @@ public static void assertExpression(final SQLCaseAssertContext assertContext, assertExtractArgExpression(assertContext, (ExtractArgExpression) actual, expected.getExtractArgExpression()); } else if (actual instanceof MatchAgainstExpression) { assertMatchSegment(assertContext, (MatchAgainstExpression) actual, expected.getMatchExpression()); - } else if (actual instanceof ColumnWithJoinOperatorSegment) { - ColumnWithJoinOperatorAssert.assertIs(assertContext, (ColumnWithJoinOperatorSegment) actual, expected.getColumnWithJoinOperatorSegment()); + } else if (actual instanceof OuterJoinExpression) { + OuterJoinExpressionAssert.assertIs(assertContext, (OuterJoinExpression) actual, expected.getOuterJoinExpression()); } else if (actual instanceof IntervalExpressionProjection) { assertIntervalExpression(assertContext, (IntervalExpressionProjection) actual, expected.getIntervalExpression()); } else if (actual instanceof MultisetExpression) { diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoClauseAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoClauseAssert.java index 712f9fe1083b5..e3c03d541909b 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoClauseAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoClauseAssert.java @@ -19,8 +19,8 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoWhenThenSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoWhenThenSegment; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.expression.ExpressionAssert; diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoElseSegmentAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoElseSegmentAssert.java index af4102ec054c1..746c381121fc6 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoElseSegmentAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoElseSegmentAssert.java @@ -20,7 +20,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoElseSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoElseSegment; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.InsertStatementAssert; diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoThenSegmentAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoThenSegmentAssert.java index 9b02954dd7ed1..0ad14ccc2c7f6 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoThenSegmentAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableConditionalIntoThenSegmentAssert.java @@ -20,7 +20,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoThenSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoThenSegment; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.InsertStatementAssert; diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableInsertIntoClauseAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableInsertIntoClauseAssert.java index c39c3cc486097..d845e4a309eb1 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableInsertIntoClauseAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/insert/MultiTableInsertIntoClauseAssert.java @@ -20,7 +20,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertIntoSegment; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.SQLSegmentAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.statement.dml.impl.InsertStatementAssert; diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/table/TableAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/table/TableAssert.java index 9115fc2d68e0b..9040d2ee9ee1d 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/table/TableAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/segment/table/TableAssert.java @@ -22,7 +22,7 @@ import lombok.NoArgsConstructor; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.XmlTableFunctionSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.xml.XmlTableFunctionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.CollectionTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.FunctionTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.JoinTableSegment; diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/InsertStatementAssert.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/InsertStatementAssert.java index 1df0c82214a76..6e8895ccbfdd2 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/InsertStatementAssert.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/asserts/statement/dml/impl/InsertStatementAssert.java @@ -26,9 +26,9 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.WithSegment; 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.sql.parser.sql.dialect.segment.oracle.insert.MultiTableConditionalIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertIntoSegment; -import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.insert.MultiTableInsertType; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableConditionalIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertIntoSegment; +import org.apache.shardingsphere.sql.parser.sql.dialect.segment.oracle.table.MultiTableInsertType; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.SQLCaseAssertContext; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.insert.InsertColumnsClauseAssert; import org.apache.shardingsphere.test.it.sql.parser.internal.asserts.segment.insert.InsertValuesClauseAssert; diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedExpression.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedExpression.java index 9486759f47f7a..0ef0b0408a2d0 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedExpression.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedExpression.java @@ -105,8 +105,8 @@ public final class ExpectedExpression extends AbstractExpectedSQLSegment { @XmlElement(name = "match-expression") private ExpectedMatchExpression matchExpression; - @XmlElement(name = "colum-with-join-operator-segment") - private ExpectedColumnWithJoinOperatorSegment columnWithJoinOperatorSegment; + @XmlElement(name = "outer-join-expression") + private ExpectedOuterJoinExpression outerJoinExpression; @XmlElement(name = "interval-expression") private ExpectedIntervalExpression intervalExpression; diff --git a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedColumnWithJoinOperatorSegment.java b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedOuterJoinExpression.java similarity index 88% rename from test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedColumnWithJoinOperatorSegment.java rename to test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedOuterJoinExpression.java index 553b8aa2c05e9..6e94e8e0d6963 100644 --- a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedColumnWithJoinOperatorSegment.java +++ b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/internal/cases/parser/jaxb/segment/impl/expr/ExpectedOuterJoinExpression.java @@ -25,11 +25,11 @@ import javax.xml.bind.annotation.XmlElement; /** - * Expected column with join operator segment. + * Expected outer join expression. */ @Getter @Setter -public final class ExpectedColumnWithJoinOperatorSegment extends AbstractExpectedSQLSegment implements ExpectedExpressionSegment { +public final class ExpectedOuterJoinExpression extends AbstractExpectedSQLSegment implements ExpectedExpressionSegment { @XmlElement private ExpectedColumn column; diff --git a/test/it/parser/src/main/resources/case/ddl/create-view.xml b/test/it/parser/src/main/resources/case/ddl/create-view.xml index 0d6972b547baf..6f895181b99d8 100644 --- a/test/it/parser/src/main/resources/case/ddl/create-view.xml +++ b/test/it/parser/src/main/resources/case/ddl/create-view.xml @@ -206,12 +206,12 @@ - + (+) - + = @@ -219,12 +219,12 @@ - + (+) - + diff --git a/test/it/parser/src/main/resources/case/dml/select-join.xml b/test/it/parser/src/main/resources/case/dml/select-join.xml index b8dd63f2a9687..48b37292b0592 100644 --- a/test/it/parser/src/main/resources/case/dml/select-join.xml +++ b/test/it/parser/src/main/resources/case/dml/select-join.xml @@ -574,12 +574,12 @@ - + (+) - + =