From dd5257dc3e897ad22b409fe4dea40688b0afe30e Mon Sep 17 00:00:00 2001 From: Zhengqiang Duan Date: Mon, 16 Oct 2023 15:52:51 +0800 Subject: [PATCH] Split sql-federation core to sql-federation-optimizer and sql-federation-executor (#28768) * Split sql-federation core to sql-federation-optimizer and sql-federation-executor * fix build error * fix unit test * fix build error * fix build error * fix build error --- kernel/sql-federation/core/pom.xml | 80 +------- .../engine/SQLFederationEngine.java | 14 +- .../sqlfederation/rule/SQLFederationRule.java | 12 +- .../resultset/SQLFederationResultSetTest.java | 2 +- kernel/sql-federation/executor/pom.xml | 152 ++++++++++++++++ .../executor/SQLFederationDataContext.java | 0 .../SQLFederationExecutorContext.java | 0 .../executor/TableScanExecutorContext.java | 0 .../enumerable/EnumerableScanExecutor.java | 22 +-- .../executor/row/MemoryEnumerator.java | 0 .../row/SQLFederationRowEnumerator.java | 0 .../EnumerableScanExecutorTest.java | 5 +- kernel/sql-federation/optimizer/pom.xml | 172 ++++++++++++++++++ .../SQLFederationCompilerEngine.java | 8 +- .../SQLFederationExecutionPlan.java | 2 +- .../optimizer}/context/OptimizerContext.java | 6 +- .../context/OptimizerContextFactory.java | 10 +- .../parser/OptimizerParserContext.java | 2 +- .../parser/OptimizerParserContextFactory.java | 4 +- .../dialect/OptimizerSQLDialectBuilder.java | 2 +- .../OptimizerSQLPropertiesBuilder.java | 2 +- .../dialect/impl/H2OptimizerBuilder.java | 4 +- .../dialect/impl/MySQLOptimizerBuilder.java | 4 +- .../impl/OpenGaussOptimizerBuilder.java | 4 +- .../dialect/impl/OracleOptimizerBuilder.java | 4 +- .../impl/PostgreSQLOptimizerBuilder.java | 4 +- .../dialect/impl/SQL92OptimizerBuilder.java | 4 +- .../impl/SQLServerOptimizerBuilder.java | 4 +- .../planner/OptimizerPlannerContext.java | 2 +- .../OptimizerPlannerContextFactory.java | 8 +- .../converter/SQLNodeConverterEngine.java | 18 +- .../mysql/MySQLMatchAgainstFunction.java | 2 +- .../mysql/SQLExtensionOperatorTable.java | 2 +- .../segment/SQLSegmentConverter.java | 2 +- .../expression/ExpressionConverter.java | 56 +++--- .../impl/BetweenExpressionConverter.java | 6 +- .../BinaryOperationExpressionConverter.java | 8 +- .../impl/CaseWhenExpressionConverter.java | 6 +- .../impl/CollateExpressionConverter.java | 8 +- .../expression/impl/ColumnConverter.java | 4 +- .../ExistsSubqueryExpressionConverter.java | 6 +- .../impl/ExtractArgExpressionConverter.java | 4 +- .../expression/impl/FunctionConverter.java | 6 +- .../impl/InExpressionConverter.java | 6 +- .../impl/ListExpressionConverter.java | 6 +- .../impl/LiteralExpressionConverter.java | 4 +- .../impl/MatchExpressionConverter.java | 8 +- .../impl/NotExpressionConverter.java | 8 +- .../ParameterMarkerExpressionConverter.java | 4 +- .../impl/RowExpressionConverter.java | 6 +- .../impl/SubqueryExpressionConverter.java | 6 +- .../impl/TrimFunctionConverter.java | 4 +- .../impl/TypeCastExpressionConverter.java | 8 +- .../UnaryOperationExpressionConverter.java | 8 +- .../impl/VariableSegmentConverter.java | 4 +- .../impl/WindowFunctionConverter.java | 4 +- .../segment/from/TableConverter.java | 12 +- .../from/impl/DeleteMultiTableConverter.java | 6 +- .../segment/from/impl/JoinTableConverter.java | 10 +- .../from/impl/SimpleTableConverter.java | 4 +- .../from/impl/SubqueryTableConverter.java | 8 +- .../segment/groupby/GroupByConverter.java | 6 +- .../segment/groupby/HavingConverter.java | 6 +- .../limit/PaginationValueSQLConverter.java | 4 +- .../segment/orderby/OrderByConverter.java | 6 +- .../item/ColumnOrderByItemConverter.java | 6 +- .../item/ExpressionOrderByItemConverter.java | 6 +- .../item/IndexOrderByItemConverter.java | 4 +- .../item/OrderByItemConverterUtils.java | 2 +- .../segment/projection/DistinctConverter.java | 4 +- .../projection/ProjectionsConverter.java | 14 +- .../impl/AggregationProjectionConverter.java | 6 +- .../impl/ColumnProjectionConverter.java | 6 +- .../projection/impl/DataTypeConverter.java | 4 +- .../impl/ExpressionProjectionConverter.java | 6 +- .../impl/ShorthandProjectionConverter.java | 4 +- .../impl/SubqueryProjectionConverter.java | 6 +- .../segment/where/WhereConverter.java | 6 +- .../segment/window/WindowConverter.java | 6 +- .../converter/segment/with/WithConverter.java | 8 +- .../statement/SQLStatementConverter.java | 2 +- .../delete/DeleteStatementConverter.java | 14 +- .../explain/ExplainStatementConverter.java | 12 +- .../insert/InsertStatementConverter.java | 12 +- .../merge/MergeStatementConverter.java | 8 +- .../select/SelectStatementConverter.java | 24 +-- .../update/UpdateStatementConverter.java | 16 +- .../type/CombineOperatorConverter.java | 2 +- .../converter/type/DataTypeConverter.java | 2 +- .../OptimizationSQLNodeConvertException.java | 4 +- .../schema/SQLFederationDatabase.java | 2 +- .../metadata/schema/SQLFederationSchema.java | 6 +- .../metadata/schema/SQLFederationTable.java | 18 +- .../schema/table}/EmptyRowEnumerator.java | 2 +- .../metadata/schema/table/ScanExecutor.java | 36 ++++ .../schema/table/ScanExecutorContext.java} | 6 +- .../util/SQLFederationDataTypeUtils.java | 2 +- .../view/ShardingSphereViewExpander.java | 4 +- .../operator/logical/LogicalScan.java | 4 +- .../operator/physical/EnumerableScan.java | 6 +- .../util/LogicalScanPushDownRelBuilder.java | 2 +- .../operator/util/LogicalScanRelShuttle.java | 4 +- .../cache/ExecutionPlanCacheBuilder.java | 4 +- .../planner/cache/ExecutionPlanCacheKey.java | 4 +- .../cache/ExecutionPlanCacheLoader.java | 4 +- .../EnumerableScanConverterRule.java | 6 +- .../PushFilterIntoScanRule.java | 4 +- .../PushProjectIntoScanRule.java | 4 +- .../util/SQLFederationFunctionUtils.java | 2 +- .../util/SQLFederationPlannerUtils.java | 10 +- .../optimizer/sql}/SQLDialectFactory.java | 2 +- .../statement/SQLStatementCompiler.java | 10 +- .../statement/SQLStatementCompilerEngine.java | 8 +- .../SQLStatementCompilerEngineFactory.java | 2 +- .../statistic/SQLFederationStatistic.java | 2 +- ...parser.dialect.OptimizerSQLDialectBuilder} | 14 +- .../src/main/resources/saffron.properties | 0 .../context/OptimizerContextTest.java | 6 +- .../type/CombineOperatorConverterTest.java | 2 +- .../optimizer}/it/SQLStatementCompilerIT.java | 8 +- .../sqlfederation/optimizer}/it/TestCase.java | 2 +- .../optimizer}/it/TestCaseAssertion.java | 2 +- .../optimizer}/it/TestCases.java | 2 +- .../optimizer}/it/TestCasesLoader.java | 2 +- .../cases/federation-query-sql-cases.xml | 0 .../src/test/resources/logback-test.xml | 33 ++++ kernel/sql-federation/pom.xml | 2 + .../converter/SQLNodeConverterEngineIT.java | 4 +- 128 files changed, 766 insertions(+), 448 deletions(-) create mode 100644 kernel/sql-federation/executor/pom.xml rename kernel/sql-federation/{core => executor}/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationDataContext.java (100%) rename kernel/sql-federation/{core => executor}/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationExecutorContext.java (100%) rename kernel/sql-federation/{core => executor}/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TableScanExecutorContext.java (100%) rename kernel/sql-federation/{core => executor}/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java (95%) rename kernel/sql-federation/{core => executor}/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/MemoryEnumerator.java (100%) rename kernel/sql-federation/{core => executor}/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/SQLFederationRowEnumerator.java (100%) rename kernel/sql-federation/{core => executor}/src/test/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorTest.java (93%) create mode 100644 kernel/sql-federation/optimizer/pom.xml rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/SQLFederationCompilerEngine.java (82%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/SQLFederationExecutionPlan.java (95%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/OptimizerContext.java (91%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/OptimizerContextFactory.java (82%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/OptimizerParserContext.java (94%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/OptimizerParserContextFactory.java (91%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/OptimizerSQLDialectBuilder.java (93%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/OptimizerSQLPropertiesBuilder.java (96%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/impl/H2OptimizerBuilder.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/impl/MySQLOptimizerBuilder.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/impl/OracleOptimizerBuilder.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/impl/SQL92OptimizerBuilder.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/parser/dialect/impl/SQLServerOptimizerBuilder.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/planner/OptimizerPlannerContext.java (95%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/planner/OptimizerPlannerContextFactory.java (92%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/SQLNodeConverterEngine.java (77%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/function/dialect/mysql/MySQLMatchAgainstFunction.java (97%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/function/dialect/mysql/SQLExtensionOperatorTable.java (97%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/SQLSegmentConverter.java (94%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/ExpressionConverter.java (72%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/BetweenExpressionConverter.java (88%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/BinaryOperationExpressionConverter.java (93%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/CaseWhenExpressionConverter.java (91%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/CollateExpressionConverter.java (81%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/ColumnConverter.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/ExistsSubqueryExpressionConverter.java (86%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/ExtractArgExpressionConverter.java (88%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/FunctionConverter.java (92%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/InExpressionConverter.java (88%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/ListExpressionConverter.java (85%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/LiteralExpressionConverter.java (94%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/MatchExpressionConverter.java (86%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/NotExpressionConverter.java (82%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/ParameterMarkerExpressionConverter.java (88%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/RowExpressionConverter.java (85%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/SubqueryExpressionConverter.java (82%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/TrimFunctionConverter.java (93%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/TypeCastExpressionConverter.java (84%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/UnaryOperationExpressionConverter.java (87%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/VariableSegmentConverter.java (87%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/expression/impl/WindowFunctionConverter.java (93%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/from/TableConverter.java (80%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/from/impl/DeleteMultiTableConverter.java (88%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/from/impl/JoinTableConverter.java (87%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/from/impl/SimpleTableConverter.java (93%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/from/impl/SubqueryTableConverter.java (86%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/groupby/GroupByConverter.java (83%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/groupby/HavingConverter.java (81%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/limit/PaginationValueSQLConverter.java (92%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/orderby/OrderByConverter.java (82%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/orderby/item/ColumnOrderByItemConverter.java (89%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/orderby/item/ExpressionOrderByItemConverter.java (88%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/orderby/item/IndexOrderByItemConverter.java (92%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/orderby/item/OrderByItemConverterUtils.java (97%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/DistinctConverter.java (89%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/ProjectionsConverter.java (80%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/impl/AggregationProjectionConverter.java (93%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/impl/ColumnProjectionConverter.java (86%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/impl/DataTypeConverter.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/impl/ExpressionProjectionConverter.java (87%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/impl/ShorthandProjectionConverter.java (92%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/projection/impl/SubqueryProjectionConverter.java (89%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/where/WhereConverter.java (81%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/window/WindowConverter.java (87%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/segment/with/WithConverter.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/statement/SQLStatementConverter.java (94%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/statement/delete/DeleteStatementConverter.java (82%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/statement/explain/ExplainStatementConverter.java (83%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/statement/insert/InsertStatementConverter.java (86%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/statement/merge/MergeStatementConverter.java (81%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/statement/select/SelectStatementConverter.java (78%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/statement/update/UpdateStatementConverter.java (83%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/type/CombineOperatorConverter.java (97%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/type/DataTypeConverter.java (96%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/exception/OptimizationSQLNodeConvertException.java (95%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/metadata/schema/SQLFederationDatabase.java (96%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/metadata/schema/SQLFederationSchema.java (92%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/metadata/schema/SQLFederationTable.java (85%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table}/EmptyRowEnumerator.java (93%) create mode 100644 kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutor.java rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorContext.java => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutorContext.java} (86%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/metadata/util/SQLFederationDataTypeUtils.java (98%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/metadata/view/ShardingSphereViewExpander.java (93%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/operator/logical/LogicalScan.java (95%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/operator/physical/EnumerableScan.java (94%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/operator/util/LogicalScanPushDownRelBuilder.java (96%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/operator/util/LogicalScanRelShuttle.java (91%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/cache/ExecutionPlanCacheBuilder.java (91%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/cache/ExecutionPlanCacheKey.java (90%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/cache/ExecutionPlanCacheLoader.java (89%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/rule/converter/EnumerableScanConverterRule.java (87%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/rule/transformation/PushFilterIntoScanRule.java (94%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/rule/transformation/PushProjectIntoScanRule.java (94%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/util/SQLFederationFunctionUtils.java (98%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/planner/util/SQLFederationPlannerUtils.java (96%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/executor => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/sql}/SQLDialectFactory.java (97%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/statement/SQLStatementCompiler.java (88%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/statement/SQLStatementCompilerEngine.java (83%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/statement/SQLStatementCompilerEngineFactory.java (96%) rename kernel/sql-federation/{core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer}/statistic/SQLFederationStatistic.java (95%) rename kernel/sql-federation/{core/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder => optimizer/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder} (52%) rename kernel/sql-federation/{core => optimizer}/src/main/resources/saffron.properties (100%) rename kernel/sql-federation/{core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer}/context/OptimizerContextTest.java (91%) rename kernel/sql-federation/{core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer}/converter/type/CombineOperatorConverterTest.java (96%) rename kernel/sql-federation/{core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer}/it/SQLStatementCompilerIT.java (98%) rename kernel/sql-federation/{core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer}/it/TestCase.java (95%) rename kernel/sql-federation/{core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer}/it/TestCaseAssertion.java (95%) rename kernel/sql-federation/{core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer}/it/TestCases.java (95%) rename kernel/sql-federation/{core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler => optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer}/it/TestCasesLoader.java (97%) rename kernel/sql-federation/{core => optimizer}/src/test/resources/cases/federation-query-sql-cases.xml (100%) create mode 100644 kernel/sql-federation/optimizer/src/test/resources/logback-test.xml diff --git a/kernel/sql-federation/core/pom.xml b/kernel/sql-federation/core/pom.xml index 813fe0ea35c14..da3256bfee68f 100644 --- a/kernel/sql-federation/core/pom.xml +++ b/kernel/sql-federation/core/pom.xml @@ -34,88 +34,14 @@ org.apache.shardingsphere - shardingsphere-infra-executor - ${project.version} - - - org.apache.shardingsphere - shardingsphere-infra-merge - ${project.version} - - - org.apache.shardingsphere - shardingsphere-infra-context - ${project.version} - - - org.apache.shardingsphere - shardingsphere-infra-common - ${project.version} - - - org.apache.shardingsphere - shardingsphere-infra-binder - ${project.version} - - - com.google.code.gson - gson + shardingsphere-sql-federation-optimizer + 5.4.1-SNAPSHOT org.apache.shardingsphere - shardingsphere-sql-parser-core + shardingsphere-sql-federation-executor ${project.version} - - org.apache.calcite - calcite-core - - - com.jayway.jsonpath - json-path - - - org.immutables - value - provided - - - - org.apache.shardingsphere - shardingsphere-parser-sql-sql92 - ${project.version} - test - - - org.apache.shardingsphere - shardingsphere-parser-sql-mysql - ${project.version} - test - - - org.apache.shardingsphere - shardingsphere-parser-sql-postgresql - ${project.version} - test - - - org.apache.shardingsphere - shardingsphere-parser-sql-oracle - ${project.version} - test - - - org.apache.shardingsphere - shardingsphere-parser-sql-sqlserver - ${project.version} - test - - - org.apache.shardingsphere - shardingsphere-parser-sql-opengauss - ${project.version} - test - org.apache.shardingsphere shardingsphere-test-fixture-database diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngine.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngine.java index a7a2d8f37b512..6af50bf6d2e34 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngine.java +++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/engine/SQLFederationEngine.java @@ -43,17 +43,17 @@ import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereStatistics; import org.apache.shardingsphere.infra.rule.ShardingSphereRule; import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPILoader; -import org.apache.shardingsphere.sqlfederation.compiler.SQLFederationCompilerEngine; -import org.apache.shardingsphere.sqlfederation.compiler.SQLFederationExecutionPlan; -import org.apache.shardingsphere.sqlfederation.compiler.context.OptimizerContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.planner.OptimizerPlannerContext; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.schema.SQLFederationTable; -import org.apache.shardingsphere.sqlfederation.compiler.planner.cache.ExecutionPlanCacheKey; -import org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompiler; import org.apache.shardingsphere.sqlfederation.executor.SQLFederationDataContext; import org.apache.shardingsphere.sqlfederation.executor.SQLFederationExecutorContext; import org.apache.shardingsphere.sqlfederation.executor.TableScanExecutorContext; import org.apache.shardingsphere.sqlfederation.executor.enumerable.EnumerableScanExecutor; +import org.apache.shardingsphere.sqlfederation.optimizer.SQLFederationCompilerEngine; +import org.apache.shardingsphere.sqlfederation.optimizer.SQLFederationExecutionPlan; +import org.apache.shardingsphere.sqlfederation.optimizer.context.OptimizerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.planner.OptimizerPlannerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationTable; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.cache.ExecutionPlanCacheKey; +import org.apache.shardingsphere.sqlfederation.optimizer.statement.SQLStatementCompiler; import org.apache.shardingsphere.sqlfederation.resultset.SQLFederationResultSet; import org.apache.shardingsphere.sqlfederation.rule.SQLFederationRule; import org.apache.shardingsphere.sqlfederation.spi.SQLFederationDecider; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/SQLFederationRule.java b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/SQLFederationRule.java index af866624c598a..9e65c7173b2b6 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/SQLFederationRule.java +++ b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/rule/SQLFederationRule.java @@ -24,12 +24,12 @@ import org.apache.shardingsphere.infra.rule.identifier.scope.GlobalRule; import org.apache.shardingsphere.infra.rule.identifier.type.MetaDataHeldRule; import org.apache.shardingsphere.sqlfederation.api.config.SQLFederationRuleConfiguration; -import org.apache.shardingsphere.sqlfederation.compiler.context.OptimizerContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.OptimizerContextFactory; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.OptimizerParserContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLPropertiesBuilder; -import org.apache.shardingsphere.sqlfederation.compiler.context.planner.OptimizerPlannerContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.planner.OptimizerPlannerContextFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.context.OptimizerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.OptimizerContextFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.OptimizerParserContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLPropertiesBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.planner.OptimizerPlannerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.planner.OptimizerPlannerContextFactory; import java.util.Map; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/resultset/SQLFederationResultSetTest.java b/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/resultset/SQLFederationResultSetTest.java index 0c3dee0a65e95..a305ec139974d 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/resultset/SQLFederationResultSetTest.java +++ b/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/resultset/SQLFederationResultSetTest.java @@ -25,7 +25,7 @@ import org.apache.shardingsphere.infra.binder.context.statement.dml.SelectStatementContext; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.schema.SQLFederationSchema; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationSchema; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/sql-federation/executor/pom.xml b/kernel/sql-federation/executor/pom.xml new file mode 100644 index 0000000000000..7673084ef150a --- /dev/null +++ b/kernel/sql-federation/executor/pom.xml @@ -0,0 +1,152 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-sql-federation + 5.4.1-SNAPSHOT + + shardingsphere-sql-federation-executor + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-sql-federation-optimizer + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-executor + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-merge + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-context + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-common + ${project.version} + + + org.apache.shardingsphere + shardingsphere-infra-binder + ${project.version} + + + org.immutables + value + provided + + + org.apache.shardingsphere + shardingsphere-test-fixture-database + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + javax.xml.bind + jaxb-api + test + + + com.sun.xml.bind + jaxb-core + test + + + com.sun.xml.bind + jaxb-impl + test + + + javax.activation + javax.activation-api + test + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.hamcrest + hamcrest + test + + + org.mockito + mockito-core + test + + + + + + + maven-failsafe-plugin + + + integration-tests + + integration-test + verify + + + + + + + + + + jdk8 + + 1.8 + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + + + diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationDataContext.java b/kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationDataContext.java similarity index 100% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationDataContext.java rename to kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationDataContext.java diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationExecutorContext.java b/kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationExecutorContext.java similarity index 100% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationExecutorContext.java rename to kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLFederationExecutorContext.java diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TableScanExecutorContext.java b/kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TableScanExecutorContext.java similarity index 100% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TableScanExecutorContext.java rename to kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/TableScanExecutorContext.java diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java b/kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java similarity index 95% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java rename to kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java index 528da1fea773a..f8476b4c74cac 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java +++ b/kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutor.java @@ -58,12 +58,14 @@ import org.apache.shardingsphere.infra.session.connection.ConnectionContext; import org.apache.shardingsphere.infra.session.query.QueryContext; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; -import org.apache.shardingsphere.sqlfederation.compiler.context.OptimizerContext; import org.apache.shardingsphere.sqlfederation.executor.SQLFederationExecutorContext; import org.apache.shardingsphere.sqlfederation.executor.TableScanExecutorContext; -import org.apache.shardingsphere.sqlfederation.executor.row.EmptyRowEnumerator; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table.EmptyRowEnumerator; import org.apache.shardingsphere.sqlfederation.executor.row.MemoryEnumerator; import org.apache.shardingsphere.sqlfederation.executor.row.SQLFederationRowEnumerator; +import org.apache.shardingsphere.sqlfederation.optimizer.context.OptimizerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table.ScanExecutor; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table.ScanExecutorContext; import java.sql.Connection; import java.sql.PreparedStatement; @@ -85,7 +87,7 @@ * Enumerable scan executor. */ @RequiredArgsConstructor -public final class EnumerableScanExecutor { +public final class EnumerableScanExecutor implements ScanExecutor { private static final Collection SYSTEM_CATALOG_TABLES = new HashSet<>(3, 1F); @@ -119,14 +121,8 @@ public final class EnumerableScanExecutor { SYSTEM_CATALOG_TABLES.add(PG_ROLES); } - /** - * Execute. - * - * @param table table meta data - * @param scanContext push down table scan context - * @return query results - */ - public Enumerable execute(final ShardingSphereTable table, final EnumerableScanExecutorContext scanContext) { + @Override + public Enumerable execute(final ShardingSphereTable table, final ScanExecutorContext scanContext) { String databaseName = executorContext.getDatabaseName().toLowerCase(); String schemaName = executorContext.getSchemaName().toLowerCase(); DatabaseType databaseType = optimizerContext.getParserContext(databaseName).getDatabaseType(); @@ -270,8 +266,8 @@ private void setParameters(final PreparedStatement preparedStatement, final List } } - private QueryContext createQueryContext(final ShardingSphereMetaData metaData, final EnumerableScanExecutorContext sqlString, final DatabaseType databaseType, final boolean useCache) { - String sql = sqlString.getSql().replace("\n", " "); + private QueryContext createQueryContext(final ShardingSphereMetaData metaData, final ScanExecutorContext sqlString, final DatabaseType databaseType, final boolean useCache) { + String sql = sqlString.getSql().replace(System.lineSeparator(), " "); SQLStatement sqlStatement = new SQLStatementParserEngine(databaseType, optimizerContext.getSqlParserRule().getSqlStatementCache(), optimizerContext.getSqlParserRule().getParseTreeCache(), optimizerContext.getSqlParserRule().isSqlCommentParseEnabled()).parse(sql, useCache); diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/MemoryEnumerator.java b/kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/MemoryEnumerator.java similarity index 100% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/MemoryEnumerator.java rename to kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/MemoryEnumerator.java diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/SQLFederationRowEnumerator.java b/kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/SQLFederationRowEnumerator.java similarity index 100% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/SQLFederationRowEnumerator.java rename to kernel/sql-federation/executor/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/SQLFederationRowEnumerator.java diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorTest.java b/kernel/sql-federation/executor/src/test/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorTest.java similarity index 93% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorTest.java rename to kernel/sql-federation/executor/src/test/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorTest.java index 2101dd39b37a5..727cb7073749c 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorTest.java +++ b/kernel/sql-federation/executor/src/test/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorTest.java @@ -27,8 +27,9 @@ import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereStatistics; import org.apache.shardingsphere.infra.metadata.statistics.ShardingSphereTableData; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; -import org.apache.shardingsphere.sqlfederation.compiler.context.OptimizerContext; import org.apache.shardingsphere.sqlfederation.executor.TableScanExecutorContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.OptimizerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table.ScanExecutorContext; import org.junit.jupiter.api.Test; import java.util.Collections; @@ -61,7 +62,7 @@ void assertExecuteWithStatistics() { ShardingSphereTable shardingSphereTable = mock(ShardingSphereTable.class); when(shardingSphereTable.getName()).thenReturn("test"); Enumerable enumerable = new EnumerableScanExecutor(null, null, null, optimizerContext, null, executorContext, statistics) - .execute(shardingSphereTable, mock(EnumerableScanExecutorContext.class)); + .execute(shardingSphereTable, mock(ScanExecutorContext.class)); try (Enumerator actual = enumerable.enumerator()) { actual.moveNext(); Object row = actual.current(); diff --git a/kernel/sql-federation/optimizer/pom.xml b/kernel/sql-federation/optimizer/pom.xml new file mode 100644 index 0000000000000..dc7d5db973917 --- /dev/null +++ b/kernel/sql-federation/optimizer/pom.xml @@ -0,0 +1,172 @@ + + + + + 4.0.0 + + org.apache.shardingsphere + shardingsphere-sql-federation + 5.4.1-SNAPSHOT + + shardingsphere-sql-federation-optimizer + ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-sql-parser-core + ${project.version} + + + org.apache.calcite + calcite-core + + + com.jayway.jsonpath + json-path + + + org.immutables + value + provided + + + + org.apache.shardingsphere + shardingsphere-parser-sql-sql92 + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-parser-sql-mysql + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-parser-sql-postgresql + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-parser-sql-oracle + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-parser-sql-sqlserver + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-parser-sql-opengauss + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-test-fixture-database + ${project.version} + test + + + org.apache.shardingsphere + shardingsphere-test-util + ${project.version} + test + + + javax.xml.bind + jaxb-api + test + + + com.sun.xml.bind + jaxb-core + test + + + com.sun.xml.bind + jaxb-impl + test + + + javax.activation + javax.activation-api + test + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.hamcrest + hamcrest + test + + + org.mockito + mockito-core + test + + + + + + + maven-failsafe-plugin + + + integration-tests + + integration-test + verify + + + + + + + + + + jdk8 + + 1.8 + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + + + diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/SQLFederationCompilerEngine.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/SQLFederationCompilerEngine.java similarity index 82% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/SQLFederationCompilerEngine.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/SQLFederationCompilerEngine.java index 33fdbe240dacf..3f38863ac94cb 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/SQLFederationCompilerEngine.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/SQLFederationCompilerEngine.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler; +package org.apache.shardingsphere.sqlfederation.optimizer; import org.apache.shardingsphere.sql.parser.api.CacheOption; -import org.apache.shardingsphere.sqlfederation.compiler.planner.cache.ExecutionPlanCacheKey; -import org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompilerEngine; -import org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompilerEngineFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.cache.ExecutionPlanCacheKey; +import org.apache.shardingsphere.sqlfederation.optimizer.statement.SQLStatementCompilerEngine; +import org.apache.shardingsphere.sqlfederation.optimizer.statement.SQLStatementCompilerEngineFactory; /** * SQL federation compiler engine. diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/SQLFederationExecutionPlan.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/SQLFederationExecutionPlan.java similarity index 95% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/SQLFederationExecutionPlan.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/SQLFederationExecutionPlan.java index 28471d833904f..6b9726a026e0d 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/SQLFederationExecutionPlan.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/SQLFederationExecutionPlan.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler; +package org.apache.shardingsphere.sqlfederation.optimizer; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContext.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContext.java similarity index 91% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContext.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContext.java index 7a132215c0df5..ba38c0651391c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContext.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContext.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context; +package org.apache.shardingsphere.sqlfederation.optimizer.context; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.parser.rule.SQLParserRule; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.OptimizerParserContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.planner.OptimizerPlannerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.OptimizerParserContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.planner.OptimizerPlannerContext; import java.util.Map; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContextFactory.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContextFactory.java similarity index 82% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContextFactory.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContextFactory.java index 74bfe5e046e4d..91d8f66ab28c5 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContextFactory.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContextFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context; +package org.apache.shardingsphere.sqlfederation.optimizer.context; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -24,10 +24,10 @@ import org.apache.shardingsphere.parser.rule.SQLParserRule; import org.apache.shardingsphere.parser.rule.builder.DefaultSQLParserRuleConfigurationBuilder; import org.apache.shardingsphere.parser.rule.builder.SQLParserRuleBuilder; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.OptimizerParserContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.OptimizerParserContextFactory; -import org.apache.shardingsphere.sqlfederation.compiler.context.planner.OptimizerPlannerContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.planner.OptimizerPlannerContextFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.OptimizerParserContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.OptimizerParserContextFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.context.planner.OptimizerPlannerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.planner.OptimizerPlannerContextFactory; import java.util.Map; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContext.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/OptimizerParserContext.java similarity index 94% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContext.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/OptimizerParserContext.java index 448bfaf8f9098..ef34bd234830b 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContext.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/OptimizerParserContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContextFactory.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/OptimizerParserContextFactory.java similarity index 91% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContextFactory.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/OptimizerParserContextFactory.java index 527f241ed4376..1da3022d0e5e2 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/OptimizerParserContextFactory.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/OptimizerParserContextFactory.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLPropertiesBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLPropertiesBuilder; import java.util.Map; import java.util.Map.Entry; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/OptimizerSQLDialectBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLDialectBuilder.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/OptimizerSQLDialectBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLDialectBuilder.java index 1ac96e9632f5f..716527e0417db 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/OptimizerSQLDialectBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLDialectBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect; import org.apache.shardingsphere.infra.database.core.spi.DatabaseTypedSPI; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/OptimizerSQLPropertiesBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLPropertiesBuilder.java similarity index 96% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/OptimizerSQLPropertiesBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLPropertiesBuilder.java index 149edd9c6b513..49353ee08e37c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/OptimizerSQLPropertiesBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/OptimizerSQLPropertiesBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/H2OptimizerBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/H2OptimizerBuilder.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/H2OptimizerBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/H2OptimizerBuilder.java index 197cf33478268..2e81a4b2aa4a9 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/H2OptimizerBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/H2OptimizerBuilder.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; import org.apache.calcite.sql.fun.SqlLibrary; import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder; import java.util.Properties; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/MySQLOptimizerBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/MySQLOptimizerBuilder.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/MySQLOptimizerBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/MySQLOptimizerBuilder.java index d11ca1d6547e1..f0030ff164582 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/MySQLOptimizerBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/MySQLOptimizerBuilder.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; import org.apache.calcite.sql.fun.SqlLibrary; import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder; import java.util.Properties; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java index 5ac4d431c722e..baf5a2c6dc10e 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OpenGaussOptimizerBuilder.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; import org.apache.calcite.sql.fun.SqlLibrary; import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder; import java.util.Properties; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/OracleOptimizerBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OracleOptimizerBuilder.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/OracleOptimizerBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OracleOptimizerBuilder.java index 1e4f566d5362b..af09e6624ab26 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/OracleOptimizerBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/OracleOptimizerBuilder.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; import org.apache.calcite.sql.fun.SqlLibrary; import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder; import java.util.Properties; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java index 229482b841fd0..50666b36a434e 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/PostgreSQLOptimizerBuilder.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; import org.apache.calcite.sql.fun.SqlLibrary; import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder; import java.util.Properties; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/SQL92OptimizerBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/SQL92OptimizerBuilder.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/SQL92OptimizerBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/SQL92OptimizerBuilder.java index dae4bcdd71374..310a16277770a 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/SQL92OptimizerBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/SQL92OptimizerBuilder.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; import org.apache.calcite.sql.fun.SqlLibrary; import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder; import java.util.Properties; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/SQLServerOptimizerBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/SQLServerOptimizerBuilder.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/SQLServerOptimizerBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/SQLServerOptimizerBuilder.java index d7905e6bf755c..bdc5fda83ccb8 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/parser/dialect/impl/SQLServerOptimizerBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/parser/dialect/impl/SQLServerOptimizerBuilder.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl; import org.apache.calcite.config.CalciteConnectionProperty; import org.apache.calcite.config.Lex; import org.apache.calcite.sql.fun.SqlLibrary; import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder; import java.util.Properties; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/planner/OptimizerPlannerContext.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/planner/OptimizerPlannerContext.java similarity index 95% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/planner/OptimizerPlannerContext.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/planner/OptimizerPlannerContext.java index 440291d14c4c4..a2b8bbcfd2bb4 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/planner/OptimizerPlannerContext.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/planner/OptimizerPlannerContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.planner; +package org.apache.shardingsphere.sqlfederation.optimizer.context.planner; import lombok.RequiredArgsConstructor; import org.apache.calcite.sql.validate.SqlValidator; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/planner/OptimizerPlannerContextFactory.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/planner/OptimizerPlannerContextFactory.java similarity index 92% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/planner/OptimizerPlannerContextFactory.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/planner/OptimizerPlannerContextFactory.java index 08999b9105a6d..864ba0c1acfca 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/context/planner/OptimizerPlannerContextFactory.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/context/planner/OptimizerPlannerContextFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context.planner; +package org.apache.shardingsphere.sqlfederation.optimizer.context.planner; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -30,9 +30,9 @@ import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.parser.rule.SQLParserRule; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.OptimizerParserContext; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.schema.SQLFederationSchema; -import org.apache.shardingsphere.sqlfederation.compiler.planner.util.SQLFederationPlannerUtils; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.OptimizerParserContext; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationSchema; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.util.SQLFederationPlannerUtils; import java.util.LinkedHashMap; import java.util.Map; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/SQLNodeConverterEngine.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/SQLNodeConverterEngine.java similarity index 77% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/SQLNodeConverterEngine.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/SQLNodeConverterEngine.java index bdd58388aa322..43c50f0da3df0 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/SQLNodeConverterEngine.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/SQLNodeConverterEngine.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter; +package org.apache.shardingsphere.sqlfederation.optimizer.converter; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -24,16 +24,16 @@ import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.ExplainStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DeleteStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; +import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.MergeStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.UpdateStatement; -import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.MergeStatement; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.delete.DeleteStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.explain.ExplainStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.insert.InsertStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.merge.MergeStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.update.UpdateStatementConverter; -import org.apache.shardingsphere.sqlfederation.exception.OptimizationSQLNodeConvertException; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.delete.DeleteStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.explain.ExplainStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.insert.InsertStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.merge.MergeStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.update.UpdateStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.exception.OptimizationSQLNodeConvertException; /** * SQL node converter engine. diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/function/dialect/mysql/MySQLMatchAgainstFunction.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/function/dialect/mysql/MySQLMatchAgainstFunction.java similarity index 97% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/function/dialect/mysql/MySQLMatchAgainstFunction.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/function/dialect/mysql/MySQLMatchAgainstFunction.java index 797b12367ef58..66ae68cee85bd 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/function/dialect/mysql/MySQLMatchAgainstFunction.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/function/dialect/mysql/MySQLMatchAgainstFunction.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.function.dialect.mysql; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql; import org.apache.calcite.sql.SqlCall; import org.apache.calcite.sql.SqlFunction; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/function/dialect/mysql/SQLExtensionOperatorTable.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/function/dialect/mysql/SQLExtensionOperatorTable.java similarity index 97% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/function/dialect/mysql/SQLExtensionOperatorTable.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/function/dialect/mysql/SQLExtensionOperatorTable.java index 4facb08895ad8..b9fe176593a5d 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/function/dialect/mysql/SQLExtensionOperatorTable.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/function/dialect/mysql/SQLExtensionOperatorTable.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.function.dialect.mysql; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/SQLSegmentConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/SQLSegmentConverter.java similarity index 94% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/SQLSegmentConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/SQLSegmentConverter.java index a89c709e02b97..b8ffef39e5d5b 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/SQLSegmentConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/SQLSegmentConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment; import org.apache.calcite.sql.SqlNode; import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/ExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/ExpressionConverter.java similarity index 72% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/ExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/ExpressionConverter.java index 248283a17c973..add0102955f7b 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/ExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/ExpressionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression; import org.apache.calcite.sql.SqlNode; import org.apache.shardingsphere.infra.exception.core.external.sql.type.generic.UnsupportedSQLOperationException; @@ -24,46 +24,46 @@ 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.CollateExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExistsSubqueryExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; 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.ListExpression; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.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; +import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.UnaryOperationExpression; 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.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; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.MatchAgainstExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationProjectionSegment; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CollateExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.RowExpression; -import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.UnaryOperationExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DataTypeSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.BetweenExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.BinaryOperationExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.CaseWhenExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ColumnConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.CollateExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ExistsSubqueryExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ExtractArgExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.FunctionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.InExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ListExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.LiteralExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ParameterMarkerExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.SubqueryExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.TypeCastExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.UnaryOperationExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl.AggregationProjectionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl.DataTypeConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.NotExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.MatchExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.RowExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.VariableSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.BetweenExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.BinaryOperationExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.CaseWhenExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.CollateExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ColumnConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ExistsSubqueryExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ExtractArgExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.FunctionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.InExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ListExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.LiteralExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.MatchExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.NotExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ParameterMarkerExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.RowExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.SubqueryExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.TypeCastExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.UnaryOperationExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.VariableSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl.AggregationProjectionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl.DataTypeConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/BetweenExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/BetweenExpressionConverter.java similarity index 88% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/BetweenExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/BetweenExpressionConverter.java index dd4236b647ad6..7cf5a3bf1f8b5 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/BetweenExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/BetweenExpressionConverter.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BetweenExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.ArrayList; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/BinaryOperationExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/BinaryOperationExpressionConverter.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/BinaryOperationExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/BinaryOperationExpressionConverter.java index 2208b48e5c563..da3590739a1f4 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/BinaryOperationExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/BinaryOperationExpressionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import com.google.common.base.Preconditions; import org.apache.calcite.sql.SqlBasicCall; @@ -27,9 +27,9 @@ import org.apache.commons.collections4.map.CaseInsensitiveMap; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.function.dialect.mysql.SQLExtensionOperatorTable; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql.SQLExtensionOperatorTable; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Collections; import java.util.LinkedList; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/CaseWhenExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/CaseWhenExpressionConverter.java similarity index 91% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/CaseWhenExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/CaseWhenExpressionConverter.java index d12b17b068321..2c694d96295c6 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/CaseWhenExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/CaseWhenExpressionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlLiteral; @@ -26,8 +26,8 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CaseWhenExpression; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Arrays; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/CollateExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/CollateExpressionConverter.java similarity index 81% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/CollateExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/CollateExpressionConverter.java index 24857f425e8f7..ec584d92abc36 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/CollateExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/CollateExpressionConverter.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlNodeList; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CollateExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.function.dialect.mysql.SQLExtensionOperatorTable; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql.SQLExtensionOperatorTable; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.LinkedList; import java.util.List; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ColumnConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ColumnConverter.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ColumnConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ColumnConverter.java index 0668a96ac8b04..f69be7700c07d 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ColumnConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ColumnConverter.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OwnerSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.ArrayList; import java.util.List; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ExistsSubqueryExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ExistsSubqueryExpressionConverter.java similarity index 86% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ExistsSubqueryExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ExistsSubqueryExpressionConverter.java index 3713e7700e2bf..cfd128ebc5556 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ExistsSubqueryExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ExistsSubqueryExpressionConverter.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExistsSubqueryExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; import java.util.Collections; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ExtractArgExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ExtractArgExpressionConverter.java similarity index 88% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ExtractArgExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ExtractArgExpressionConverter.java index 7c043e35ad193..a2beaaa190e84 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ExtractArgExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ExtractArgExpressionConverter.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExtractArgExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/FunctionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/FunctionConverter.java similarity index 92% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/FunctionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/FunctionConverter.java index 3cb9c041603ab..70990573bcaac 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/FunctionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/FunctionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlFunctionCategory; @@ -30,8 +30,8 @@ import org.apache.calcite.sql.validate.SqlNameMatchers; 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.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Collection; import java.util.Collections; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/InExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/InExpressionConverter.java similarity index 88% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/InExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/InExpressionConverter.java index bcff83a5c7577..e3f30ba3b9b64 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/InExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/InExpressionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; @@ -23,8 +23,8 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.ArrayList; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ListExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ListExpressionConverter.java similarity index 85% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ListExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ListExpressionConverter.java index 04d4c978cab29..65d649ed558f7 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ListExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ListExpressionConverter.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlNodeList; import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ListExpression; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/LiteralExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/LiteralExpressionConverter.java similarity index 94% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/LiteralExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/LiteralExpressionConverter.java index 8d2cc6b4ed2bb..1c5ac07902cf5 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/LiteralExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/LiteralExpressionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.avatica.util.TimeUnit; import org.apache.calcite.sql.SqlIntervalQualifier; @@ -24,7 +24,7 @@ import org.apache.calcite.sql.fun.SqlTrimFunction.Flag; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.math.BigDecimal; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/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 similarity index 86% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/MatchExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/MatchExpressionConverter.java index 9c359c7c3700e..6804c80efee9f 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/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 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; @@ -24,9 +24,9 @@ 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.common.segment.generic.OwnerSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.function.dialect.mysql.SQLExtensionOperatorTable; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql.SQLExtensionOperatorTable; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.ArrayList; import java.util.LinkedList; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/NotExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/NotExpressionConverter.java similarity index 82% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/NotExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/NotExpressionConverter.java index 85fdef1aab440..eb171aa650d96 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/NotExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/NotExpressionConverter.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.function.dialect.mysql.SQLExtensionOperatorTable; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql.SQLExtensionOperatorTable; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.LinkedList; import java.util.List; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ParameterMarkerExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ParameterMarkerExpressionConverter.java similarity index 88% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ParameterMarkerExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ParameterMarkerExpressionConverter.java index 5c2b11f7b44f8..a3fdc937d313d 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/ParameterMarkerExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/ParameterMarkerExpressionConverter.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlDynamicParam; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/RowExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/RowExpressionConverter.java similarity index 85% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/RowExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/RowExpressionConverter.java index 928b68b74205f..dbee3c0cf58da 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/RowExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/RowExpressionConverter.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.RowExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.ArrayList; import java.util.List; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/SubqueryExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/SubqueryExpressionConverter.java similarity index 82% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/SubqueryExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/SubqueryExpressionConverter.java index df53e0d618f63..f4c735d83365c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/SubqueryExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/SubqueryExpressionConverter.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlNode; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubqueryExpressionSegment; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/TrimFunctionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/TrimFunctionConverter.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/TrimFunctionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/TrimFunctionConverter.java index 3a8f27c6be94f..5cb9d30e831db 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/TrimFunctionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/TrimFunctionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; @@ -29,7 +29,7 @@ import org.apache.calcite.sql.validate.SqlNameMatchers; 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.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Collection; import java.util.LinkedList; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/TypeCastExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/TypeCastExpressionConverter.java similarity index 84% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/TypeCastExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/TypeCastExpressionConverter.java index 97387b0542ac0..bd583c0053d54 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/TypeCastExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/TypeCastExpressionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlBasicTypeNameSpec; @@ -25,9 +25,9 @@ import org.apache.calcite.sql.fun.SqlCastFunction; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.TypeCastExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.type.DataTypeConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.type.DataTypeConverter; import java.util.Arrays; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/UnaryOperationExpressionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/UnaryOperationExpressionConverter.java similarity index 87% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/UnaryOperationExpressionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/UnaryOperationExpressionConverter.java index 4c4f65543b1b0..e63946a998c05 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/UnaryOperationExpressionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/UnaryOperationExpressionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import com.google.common.base.Preconditions; import org.apache.calcite.sql.SqlBasicCall; @@ -25,9 +25,9 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.commons.collections4.map.CaseInsensitiveMap; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.UnaryOperationExpression; -import org.apache.shardingsphere.sqlfederation.compiler.converter.function.dialect.mysql.SQLExtensionOperatorTable; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.function.dialect.mysql.SQLExtensionOperatorTable; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.LinkedList; import java.util.List; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/VariableSegmentConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/VariableSegmentConverter.java similarity index 87% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/VariableSegmentConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/VariableSegmentConverter.java index ed4a5436331de..79bde9d68a5c8 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/VariableSegmentConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/VariableSegmentConverter.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dal.VariableSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/WindowFunctionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/WindowFunctionConverter.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/WindowFunctionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/WindowFunctionConverter.java index 9cb96482071c0..66afe044d1c6d 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/expression/impl/WindowFunctionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/expression/impl/WindowFunctionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; @@ -30,7 +30,7 @@ import org.apache.calcite.sql.validate.SqlNameMatchers; 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.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Collection; import java.util.LinkedList; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/TableConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/TableConverter.java similarity index 80% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/TableConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/TableConverter.java index ce7e7c97117d7..30b98a4069615 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/TableConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/TableConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from; import org.apache.calcite.sql.SqlNode; import org.apache.shardingsphere.infra.exception.core.external.sql.type.generic.UnsupportedSQLOperationException; @@ -24,11 +24,11 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SubqueryTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl.DeleteMultiTableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl.JoinTableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl.SimpleTableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl.SubqueryTableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl.DeleteMultiTableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl.JoinTableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl.SimpleTableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl.SubqueryTableConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/DeleteMultiTableConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/DeleteMultiTableConverter.java similarity index 88% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/DeleteMultiTableConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/DeleteMultiTableConverter.java index 8e7e5750999f7..ca977b74c6549 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/DeleteMultiTableConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/DeleteMultiTableConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlNode; @@ -23,8 +23,8 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.DeleteMultiTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.TableConverter; import java.util.Collection; import java.util.LinkedList; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/JoinTableConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/JoinTableConverter.java similarity index 87% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/JoinTableConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/JoinTableConverter.java index f4da9ea637c5f..623665f5741e0 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/JoinTableConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/JoinTableConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl; import org.apache.calcite.sql.JoinConditionType; import org.apache.calcite.sql.JoinType; @@ -26,10 +26,10 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.JoinTableSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ColumnConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +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 java.util.Collection; import java.util.LinkedList; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/SimpleTableConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/SimpleTableConverter.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/SimpleTableConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/SimpleTableConverter.java index f69079aae4774..f5c0f64789a04 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/SimpleTableConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/SimpleTableConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; @@ -23,9 +23,9 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OwnerSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableNameSegment; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.ArrayList; import java.util.Arrays; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/SubqueryTableConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/SubqueryTableConverter.java similarity index 86% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/SubqueryTableConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/SubqueryTableConverter.java index 14ac7130d3888..5fbecb06442e5 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/from/impl/SubqueryTableConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/from/impl/SubqueryTableConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; @@ -23,9 +23,9 @@ import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SubqueryTableSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.TableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; import java.util.ArrayList; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/groupby/GroupByConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/groupby/GroupByConverter.java similarity index 83% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/groupby/GroupByConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/groupby/GroupByConverter.java index 872b079a62cea..aff400e43ca86 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/groupby/GroupByConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/groupby/GroupByConverter.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.groupby; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.groupby; import org.apache.calcite.sql.SqlNodeList; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.item.OrderByItemConverterUtils; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.item.OrderByItemConverterUtils; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/groupby/HavingConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/groupby/HavingConverter.java similarity index 81% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/groupby/HavingConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/groupby/HavingConverter.java index 88325eff390dd..a762bd450ae62 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/groupby/HavingConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/groupby/HavingConverter.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.groupby; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.groupby; import org.apache.calcite.sql.SqlNode; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.HavingSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/limit/PaginationValueSQLConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/limit/PaginationValueSQLConverter.java similarity index 92% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/limit/PaginationValueSQLConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/limit/PaginationValueSQLConverter.java index 863f57bf1a4f2..8bc54e6de0591 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/limit/PaginationValueSQLConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/limit/PaginationValueSQLConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.limit; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.limit; import lombok.RequiredArgsConstructor; import org.apache.calcite.sql.SqlDynamicParam; @@ -25,7 +25,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.NumberLiteralPaginationValueSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.PaginationValueSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.ParameterMarkerLimitValueSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/OrderByConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/OrderByConverter.java similarity index 82% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/OrderByConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/OrderByConverter.java index 2512412b5f0f6..8f0a2425d2799 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/OrderByConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/OrderByConverter.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby; import org.apache.calcite.sql.SqlNodeList; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.item.OrderByItemConverterUtils; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.item.OrderByItemConverterUtils; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/ColumnOrderByItemConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ColumnOrderByItemConverter.java similarity index 89% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/ColumnOrderByItemConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ColumnOrderByItemConverter.java index 78a84524e94b3..090df09d34804 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/ColumnOrderByItemConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ColumnOrderByItemConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.item; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.item; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; @@ -25,8 +25,8 @@ import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType; import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ColumnConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ColumnConverter; import java.util.Collections; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/ExpressionOrderByItemConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ExpressionOrderByItemConverter.java similarity index 88% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/ExpressionOrderByItemConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ExpressionOrderByItemConverter.java index 5b6de92cd5de4..97d0703c47d1a 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/ExpressionOrderByItemConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/ExpressionOrderByItemConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.item; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.item; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; @@ -24,8 +24,8 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ExpressionOrderByItemSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Collections; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/IndexOrderByItemConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/IndexOrderByItemConverter.java similarity index 92% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/IndexOrderByItemConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/IndexOrderByItemConverter.java index fab78531ba207..fea56775e641c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/IndexOrderByItemConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/IndexOrderByItemConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.item; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.item; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlLiteral; @@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.database.core.metadata.database.enums.NullsOrderType; import org.apache.shardingsphere.sql.parser.sql.common.enums.OrderDirection; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.Collections; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/OrderByItemConverterUtils.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/OrderByItemConverterUtils.java similarity index 97% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/OrderByItemConverterUtils.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/OrderByItemConverterUtils.java index 43f9484df0824..7b8415b0f82c7 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/orderby/item/OrderByItemConverterUtils.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/orderby/item/OrderByItemConverterUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.item; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.item; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/DistinctConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/DistinctConverter.java similarity index 89% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/DistinctConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/DistinctConverter.java index 2c87554855071..633a845c6442c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/DistinctConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/DistinctConverter.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection; import org.apache.calcite.sql.SqlNodeList; import org.apache.calcite.sql.SqlSelectKeyword; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.Collections; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/ProjectionsConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/ProjectionsConverter.java similarity index 80% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/ProjectionsConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/ProjectionsConverter.java index fd4a18bbe293a..bf3b633c9343b 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/ProjectionsConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/ProjectionsConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlNodeList; @@ -27,12 +27,12 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ShorthandProjectionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.SubqueryProjectionSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl.AggregationProjectionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl.ColumnProjectionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl.ExpressionProjectionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl.ShorthandProjectionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl.SubqueryProjectionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl.AggregationProjectionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl.ColumnProjectionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl.ExpressionProjectionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl.ShorthandProjectionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl.SubqueryProjectionConverter; import java.util.Collection; import java.util.LinkedList; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/AggregationProjectionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/AggregationProjectionConverter.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/AggregationProjectionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/AggregationProjectionConverter.java index 4a217f1e90ad7..ed64a99dbcdcd 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/AggregationProjectionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/AggregationProjectionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl; import com.google.common.base.Preconditions; import org.apache.calcite.sql.SqlAggFunction; @@ -30,8 +30,8 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationDistinctProjectionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationProjectionSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Arrays; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ColumnProjectionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ColumnProjectionConverter.java similarity index 86% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ColumnProjectionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ColumnProjectionConverter.java index 372d113530f92..c915d6ed03702 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ColumnProjectionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ColumnProjectionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl; import org.apache.calcite.sql.SqlAsOperator; import org.apache.calcite.sql.SqlBasicCall; @@ -23,8 +23,8 @@ import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ColumnProjectionSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ColumnConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.impl.ColumnConverter; import java.util.Arrays; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/DataTypeConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/DataTypeConverter.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/DataTypeConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/DataTypeConverter.java index 1e94cb16ebf66..1c1d68b1be7e7 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/DataTypeConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/DataTypeConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl; import org.apache.calcite.sql.SqlDataTypeSpec; import org.apache.calcite.sql.SqlNode; @@ -23,7 +23,7 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.calcite.sql.type.SqlTypeName; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DataTypeSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.Objects; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ExpressionProjectionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ExpressionProjectionConverter.java similarity index 87% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ExpressionProjectionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ExpressionProjectionConverter.java index f2b09dc284972..189d0db4c4edb 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ExpressionProjectionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ExpressionProjectionConverter.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ExpressionProjectionSegment; import java.util.Arrays; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ShorthandProjectionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ShorthandProjectionConverter.java similarity index 92% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ShorthandProjectionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ShorthandProjectionConverter.java index 6a0c1e8fe7573..2cdfb1ec75b3a 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/ShorthandProjectionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/ShorthandProjectionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl; import com.google.common.collect.ImmutableList; import org.apache.calcite.sql.SqlIdentifier; @@ -23,7 +23,7 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ShorthandProjectionSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OwnerSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; import java.util.ArrayList; import java.util.List; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/SubqueryProjectionConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/SubqueryProjectionConverter.java similarity index 89% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/SubqueryProjectionConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/SubqueryProjectionConverter.java index 653749ce6f739..4489be4c3eff6 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/projection/impl/SubqueryProjectionConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/projection/impl/SubqueryProjectionConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.impl; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.impl; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlIdentifier; @@ -24,8 +24,8 @@ import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.enums.SubqueryType; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.SubqueryProjectionSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; import java.util.ArrayList; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/where/WhereConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/where/WhereConverter.java similarity index 81% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/where/WhereConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/where/WhereConverter.java index ddd841e0f8a1e..5d43061a5eb29 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/where/WhereConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/where/WhereConverter.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.where; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.where; import org.apache.calcite.sql.SqlNode; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/window/WindowConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/window/WindowConverter.java similarity index 87% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/window/WindowConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/window/WindowConverter.java index 3b04cf9090917..d28993fedc1e8 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/window/WindowConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/window/WindowConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.window; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.window; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlLiteral; @@ -23,8 +23,8 @@ import org.apache.calcite.sql.SqlWindow; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.WindowSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.SQLSegmentConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.SQLSegmentConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; import java.util.Collections; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/with/WithConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/with/WithConverter.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/with/WithConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/with/WithConverter.java index 3e75875e93c57..0dbf56b2500f1 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/segment/with/WithConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/segment/with/WithConverter.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.segment.with; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.with; import org.apache.calcite.sql.SqlIdentifier; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlWithItem; import org.apache.calcite.sql.SqlWith; +import org.apache.calcite.sql.SqlWithItem; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment; import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.WithSegment; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; import java.util.Collection; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/SQLStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/SQLStatementConverter.java similarity index 94% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/SQLStatementConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/SQLStatementConverter.java index 8846e12a04d51..1a28955badcd1 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/SQLStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/SQLStatementConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.statement; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.statement; import org.apache.calcite.sql.SqlNode; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/delete/DeleteStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/delete/DeleteStatementConverter.java similarity index 82% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/delete/DeleteStatementConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/delete/DeleteStatementConverter.java index 98440e09ca277..c99285f63ba98 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/delete/DeleteStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/delete/DeleteStatementConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.statement.delete; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.delete; import org.apache.calcite.sql.SqlDelete; import org.apache.calcite.sql.SqlIdentifier; @@ -26,12 +26,12 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DeleteStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.dml.DeleteStatementHandler; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.limit.PaginationValueSQLConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.OrderByConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.where.WhereConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.with.WithConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.SQLStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.TableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.limit.PaginationValueSQLConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.OrderByConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.where.WhereConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.with.WithConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.SQLStatementConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/explain/ExplainStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/explain/ExplainStatementConverter.java similarity index 83% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/explain/ExplainStatementConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/explain/ExplainStatementConverter.java index d7d0975821474..4fd23447cc311 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/explain/ExplainStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/explain/ExplainStatementConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.statement.explain; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.explain; import org.apache.calcite.sql.SqlExplain; import org.apache.calcite.sql.SqlExplainFormat; @@ -28,11 +28,11 @@ import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.UpdateStatement; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.SQLStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.delete.DeleteStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.insert.InsertStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.update.UpdateStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.SQLStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.delete.DeleteStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.insert.InsertStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.update.UpdateStatementConverter; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/insert/InsertStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/insert/InsertStatementConverter.java similarity index 86% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/insert/InsertStatementConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/insert/InsertStatementConverter.java index bdbcaee2a04f8..842d360d3b005 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/insert/InsertStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/insert/InsertStatementConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.statement.insert; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.insert; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlInsert; @@ -28,11 +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.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ColumnConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.SQLStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select.SelectStatementConverter; +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.statement.SQLStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select.SelectStatementConverter; import java.util.ArrayList; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/merge/MergeStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/merge/MergeStatementConverter.java similarity index 81% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/merge/MergeStatementConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/merge/MergeStatementConverter.java index d19b2c26adfcf..f847fa01e73e8 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/merge/MergeStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/merge/MergeStatementConverter.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.statement.merge; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.merge; import org.apache.calcite.sql.SqlMerge; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.parser.SqlParserPos; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.MergeStatement; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.SQLStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.expression.ExpressionConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.TableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.SQLStatementConverter; /** * Merge statement converter. diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/select/SelectStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/select/SelectStatementConverter.java similarity index 78% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/select/SelectStatementConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/select/SelectStatementConverter.java index 86685b01eac32..148d517cef25e 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/select/SelectStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/select/SelectStatementConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.statement.select; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.select; import org.apache.calcite.sql.SqlBasicCall; import org.apache.calcite.sql.SqlNode; @@ -27,17 +27,17 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.dml.SelectStatementHandler; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.groupby.GroupByConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.groupby.HavingConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.limit.PaginationValueSQLConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.OrderByConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.DistinctConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.projection.ProjectionsConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.where.WhereConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.window.WindowConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.SQLStatementConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.type.CombineOperatorConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.from.TableConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.groupby.GroupByConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.groupby.HavingConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.limit.PaginationValueSQLConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.OrderByConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.DistinctConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.projection.ProjectionsConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.where.WhereConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.window.WindowConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.SQLStatementConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.type.CombineOperatorConverter; import java.util.Arrays; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/update/UpdateStatementConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/update/UpdateStatementConverter.java similarity index 83% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/update/UpdateStatementConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/update/UpdateStatementConverter.java index b4efca5e2bd9d..675c03d051412 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/statement/update/UpdateStatementConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/statement/update/UpdateStatementConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.statement.update; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.update; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlNodeList; @@ -28,13 +28,13 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.LimitSegment; import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.UpdateStatement; import org.apache.shardingsphere.sql.parser.sql.dialect.handler.dml.UpdateStatementHandler; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.ExpressionConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.expression.impl.ColumnConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.from.TableConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.limit.PaginationValueSQLConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.orderby.OrderByConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.segment.where.WhereConverter; -import org.apache.shardingsphere.sqlfederation.compiler.converter.statement.SQLStatementConverter; +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.limit.PaginationValueSQLConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.orderby.OrderByConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.segment.where.WhereConverter; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.statement.SQLStatementConverter; import java.util.List; import java.util.Optional; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/CombineOperatorConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverter.java similarity index 97% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/CombineOperatorConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverter.java index a486f01bad621..41558b052aaef 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/CombineOperatorConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.type; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.type; import com.google.common.base.Preconditions; import lombok.AccessLevel; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/DataTypeConverter.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/DataTypeConverter.java similarity index 96% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/DataTypeConverter.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/DataTypeConverter.java index 34e9b381505c2..5ee1baff46b4c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/DataTypeConverter.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/DataTypeConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.type; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.type; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/exception/OptimizationSQLNodeConvertException.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/exception/OptimizationSQLNodeConvertException.java similarity index 95% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/exception/OptimizationSQLNodeConvertException.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/exception/OptimizationSQLNodeConvertException.java index ae1b1677dd104..3a63eeeb523ae 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/exception/OptimizationSQLNodeConvertException.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/exception/OptimizationSQLNodeConvertException.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.exception; +package org.apache.shardingsphere.sqlfederation.optimizer.exception; -import org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.MetaDataSQLException; import org.apache.shardingsphere.infra.exception.core.external.sql.sqlstate.XOpenSQLState; +import org.apache.shardingsphere.infra.exception.core.external.sql.type.kernel.category.MetaDataSQLException; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; /** diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationDatabase.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationDatabase.java similarity index 96% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationDatabase.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationDatabase.java index 225ab5f887bf5..342e826639db0 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationDatabase.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationDatabase.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.metadata.schema; +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema; import lombok.Getter; import org.apache.calcite.adapter.java.JavaTypeFactory; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationSchema.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationSchema.java similarity index 92% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationSchema.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationSchema.java index d9de75e115cd5..7104d37799fc9 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationSchema.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationSchema.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.metadata.schema; +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema; import lombok.Getter; import org.apache.calcite.adapter.java.JavaTypeFactory; @@ -28,8 +28,8 @@ import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereSchema; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereView; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.util.SQLFederationDataTypeUtils; -import org.apache.shardingsphere.sqlfederation.compiler.statistic.SQLFederationStatistic; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.util.SQLFederationDataTypeUtils; +import org.apache.shardingsphere.sqlfederation.optimizer.statistic.SQLFederationStatistic; import java.util.Collections; import java.util.LinkedHashMap; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationTable.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationTable.java similarity index 85% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationTable.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationTable.java index c3ed10d7ad528..1bad5e14cd39d 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/schema/SQLFederationTable.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/SQLFederationTable.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.metadata.schema; +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema; import lombok.RequiredArgsConstructor; import lombok.Setter; @@ -39,13 +39,13 @@ import org.apache.calcite.schema.TranslatableTable; import org.apache.calcite.schema.impl.AbstractTable; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; -import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; import org.apache.shardingsphere.infra.exception.core.external.sql.type.generic.UnsupportedSQLOperationException; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.util.SQLFederationDataTypeUtils; -import org.apache.shardingsphere.sqlfederation.compiler.statistic.SQLFederationStatistic; -import org.apache.shardingsphere.sqlfederation.executor.enumerable.EnumerableScanExecutor; -import org.apache.shardingsphere.sqlfederation.executor.enumerable.EnumerableScanExecutorContext; -import org.apache.shardingsphere.sqlfederation.executor.row.EmptyRowEnumerator; +import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.util.SQLFederationDataTypeUtils; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table.EmptyRowEnumerator; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table.ScanExecutor; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table.ScanExecutorContext; +import org.apache.shardingsphere.sqlfederation.optimizer.statistic.SQLFederationStatistic; import java.lang.reflect.Type; import java.util.Collections; @@ -63,7 +63,7 @@ public final class SQLFederationTable extends AbstractTable implements Queryable private final DatabaseType protocolType; @Setter - private EnumerableScanExecutor scanExecutor; + private ScanExecutor scanExecutor; @Override public RelDataType getRowType(final RelDataTypeFactory typeFactory) { @@ -102,7 +102,7 @@ public Enumerable execute(final DataContext root, final String sql, fina if (null == scanExecutor) { return createEmptyEnumerable(); } - return scanExecutor.execute(table, new EnumerableScanExecutorContext(root, sql, paramIndexes)); + return scanExecutor.execute(table, new ScanExecutorContext(root, sql, paramIndexes)); } private AbstractEnumerable createEmptyEnumerable() { diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/EmptyRowEnumerator.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/EmptyRowEnumerator.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/EmptyRowEnumerator.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/EmptyRowEnumerator.java index a283f3e89eb7c..2c8699de2bb47 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/row/EmptyRowEnumerator.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/EmptyRowEnumerator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.executor.row; +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table; import org.apache.calcite.linq4j.Enumerator; diff --git a/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutor.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutor.java new file mode 100644 index 0000000000000..2bbb4c6156d50 --- /dev/null +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutor.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table; + +import org.apache.calcite.linq4j.Enumerable; +import org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSphereTable; + +/** + * Scan executor interface. + */ +public interface ScanExecutor { + + /** + * Execute. + * + * @param table table meta data + * @param scanContext push down table scan context + * @return query results + */ + Enumerable execute(ShardingSphereTable table, ScanExecutorContext scanContext); +} diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorContext.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutorContext.java similarity index 86% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorContext.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutorContext.java index 26a6ad4cce300..cc87bdf1c3833 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/enumerable/EnumerableScanExecutorContext.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/schema/table/ScanExecutorContext.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.executor.enumerable; +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.table; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.calcite.DataContext; /** - * Enumerable push down table scan executor context. + * Scan executor context. */ @RequiredArgsConstructor @Getter -public final class EnumerableScanExecutorContext { +public final class ScanExecutorContext { private final DataContext root; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/util/SQLFederationDataTypeUtils.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/util/SQLFederationDataTypeUtils.java similarity index 98% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/util/SQLFederationDataTypeUtils.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/util/SQLFederationDataTypeUtils.java index d2d01f19e0cf7..4fd4846f5970c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/util/SQLFederationDataTypeUtils.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/util/SQLFederationDataTypeUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.metadata.util; +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/view/ShardingSphereViewExpander.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/view/ShardingSphereViewExpander.java similarity index 93% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/view/ShardingSphereViewExpander.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/view/ShardingSphereViewExpander.java index 6934f7ed64427..203bc2c09e341 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/metadata/view/ShardingSphereViewExpander.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/metadata/view/ShardingSphereViewExpander.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.metadata.view; +package org.apache.shardingsphere.sqlfederation.optimizer.metadata.view; import lombok.RequiredArgsConstructor; import org.apache.calcite.plan.RelOptTable.ViewExpander; @@ -27,7 +27,7 @@ import org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine; import org.apache.shardingsphere.parser.rule.SQLParserRule; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; -import org.apache.shardingsphere.sqlfederation.compiler.converter.SQLNodeConverterEngine; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.SQLNodeConverterEngine; import org.checkerframework.checker.nullness.qual.Nullable; import java.util.List; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/logical/LogicalScan.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/logical/LogicalScan.java similarity index 95% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/logical/LogicalScan.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/logical/LogicalScan.java index a34712cdd7ffe..05b248444031b 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/logical/LogicalScan.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/logical/LogicalScan.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.operator.logical; +package org.apache.shardingsphere.sqlfederation.optimizer.operator.logical; import lombok.Getter; import org.apache.calcite.rel.RelNode; @@ -24,7 +24,7 @@ import org.apache.calcite.rel.logical.LogicalFilter; import org.apache.calcite.rel.logical.LogicalProject; import org.apache.calcite.rel.logical.LogicalTableScan; -import org.apache.shardingsphere.sqlfederation.compiler.operator.util.LogicalScanPushDownRelBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.operator.util.LogicalScanPushDownRelBuilder; import java.util.Collections; import java.util.Objects; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/physical/EnumerableScan.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/physical/EnumerableScan.java similarity index 94% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/physical/EnumerableScan.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/physical/EnumerableScan.java index 2a52943506595..39eb1f2bbacdf 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/physical/EnumerableScan.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/physical/EnumerableScan.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.operator.physical; +package org.apache.shardingsphere.sqlfederation.optimizer.operator.physical; import lombok.Getter; import org.apache.calcite.adapter.enumerable.EnumerableConvention; @@ -35,8 +35,8 @@ import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.sql.SqlDialect; import org.apache.calcite.sql.util.SqlString; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.schema.SQLFederationTable; -import org.apache.shardingsphere.sqlfederation.executor.SQLDialectFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.sql.SQLDialectFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationTable; import java.util.Collection; import java.util.Collections; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/util/LogicalScanPushDownRelBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/util/LogicalScanPushDownRelBuilder.java similarity index 96% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/util/LogicalScanPushDownRelBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/util/LogicalScanPushDownRelBuilder.java index 2ba6137a7bcd9..8d67d7be9f3a1 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/util/LogicalScanPushDownRelBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/util/LogicalScanPushDownRelBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.operator.util; +package org.apache.shardingsphere.sqlfederation.optimizer.operator.util; import org.apache.calcite.plan.Contexts; import org.apache.calcite.plan.RelOptCluster; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/util/LogicalScanRelShuttle.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/util/LogicalScanRelShuttle.java similarity index 91% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/util/LogicalScanRelShuttle.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/util/LogicalScanRelShuttle.java index e7fa03e521f22..da0e030d24921 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/operator/util/LogicalScanRelShuttle.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/operator/util/LogicalScanRelShuttle.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.operator.util; +package org.apache.shardingsphere.sqlfederation.optimizer.operator.util; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.RelShuttleImpl; import org.apache.calcite.rel.core.TableScan; -import org.apache.shardingsphere.sqlfederation.compiler.operator.logical.LogicalScan; +import org.apache.shardingsphere.sqlfederation.optimizer.operator.logical.LogicalScan; /** * Logical scan rel shuttle. diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheBuilder.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheBuilder.java similarity index 91% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheBuilder.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheBuilder.java index 8ebe8e5a9df69..cfcc2328f2173 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheBuilder.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheBuilder.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.cache; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.cache; import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.LoadingCache; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.sql.parser.api.CacheOption; -import org.apache.shardingsphere.sqlfederation.compiler.SQLFederationExecutionPlan; +import org.apache.shardingsphere.sqlfederation.optimizer.SQLFederationExecutionPlan; /** * Execution plan cache builder. diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheKey.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheKey.java similarity index 90% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheKey.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheKey.java index 5fe2d5be72439..5f1d16e96d50f 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheKey.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheKey.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.cache; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.cache; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; -import org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompiler; +import org.apache.shardingsphere.sqlfederation.optimizer.statement.SQLStatementCompiler; import java.util.LinkedHashMap; import java.util.Map; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheLoader.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheLoader.java similarity index 89% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheLoader.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheLoader.java index 8944278c3551b..130e5e806dbf0 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/cache/ExecutionPlanCacheLoader.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/cache/ExecutionPlanCacheLoader.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.cache; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.cache; import com.github.benmanes.caffeine.cache.CacheLoader; -import org.apache.shardingsphere.sqlfederation.compiler.SQLFederationExecutionPlan; +import org.apache.shardingsphere.sqlfederation.optimizer.SQLFederationExecutionPlan; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/converter/EnumerableScanConverterRule.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/converter/EnumerableScanConverterRule.java similarity index 87% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/converter/EnumerableScanConverterRule.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/converter/EnumerableScanConverterRule.java index 0f3e06aaf60a5..3418d712eb87a 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/converter/EnumerableScanConverterRule.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/converter/EnumerableScanConverterRule.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.rule.converter; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.rule.converter; import org.apache.calcite.adapter.enumerable.EnumerableConvention; import org.apache.calcite.plan.Convention; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.convert.ConverterRule; -import org.apache.shardingsphere.sqlfederation.compiler.operator.logical.LogicalScan; -import org.apache.shardingsphere.sqlfederation.compiler.operator.physical.EnumerableScan; +import org.apache.shardingsphere.sqlfederation.optimizer.operator.logical.LogicalScan; +import org.apache.shardingsphere.sqlfederation.optimizer.operator.physical.EnumerableScan; /** * Enumerable scan converter rule. diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/transformation/PushFilterIntoScanRule.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/transformation/PushFilterIntoScanRule.java similarity index 94% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/transformation/PushFilterIntoScanRule.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/transformation/PushFilterIntoScanRule.java index 315a7935b6944..70959e3ded045 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/transformation/PushFilterIntoScanRule.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/transformation/PushFilterIntoScanRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.rule.transformation; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.rule.transformation; import org.apache.calcite.plan.RelOptRuleCall; import org.apache.calcite.plan.RelRule; @@ -23,7 +23,7 @@ import org.apache.calcite.rel.rules.TransformationRule; import org.apache.calcite.rex.RexCall; import org.apache.calcite.rex.RexNode; -import org.apache.shardingsphere.sqlfederation.compiler.operator.logical.LogicalScan; +import org.apache.shardingsphere.sqlfederation.optimizer.operator.logical.LogicalScan; import org.immutables.value.Value; import java.util.Arrays; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/transformation/PushProjectIntoScanRule.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/transformation/PushProjectIntoScanRule.java similarity index 94% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/transformation/PushProjectIntoScanRule.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/transformation/PushProjectIntoScanRule.java index 4ef2b003a54ad..2bf1dd16cca4c 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/rule/transformation/PushProjectIntoScanRule.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/rule/transformation/PushProjectIntoScanRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.rule.transformation; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.rule.transformation; import org.apache.calcite.plan.RelOptRuleCall; import org.apache.calcite.plan.RelRule; @@ -23,7 +23,7 @@ import org.apache.calcite.rel.rules.TransformationRule; import org.apache.calcite.rex.RexCall; import org.apache.calcite.rex.RexNode; -import org.apache.shardingsphere.sqlfederation.compiler.operator.logical.LogicalScan; +import org.apache.shardingsphere.sqlfederation.optimizer.operator.logical.LogicalScan; import org.immutables.value.Value; import java.util.Arrays; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/util/SQLFederationFunctionUtils.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/util/SQLFederationFunctionUtils.java similarity index 98% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/util/SQLFederationFunctionUtils.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/util/SQLFederationFunctionUtils.java index b2eb460b9c62f..8b6122a1b6959 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/util/SQLFederationFunctionUtils.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/util/SQLFederationFunctionUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.util; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/util/SQLFederationPlannerUtils.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/util/SQLFederationPlannerUtils.java similarity index 96% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/util/SQLFederationPlannerUtils.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/util/SQLFederationPlannerUtils.java index 6464237dd1640..0f7c2d6bd9e47 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/planner/util/SQLFederationPlannerUtils.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/planner/util/SQLFederationPlannerUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.planner.util; +package org.apache.shardingsphere.sqlfederation.optimizer.planner.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -50,10 +50,10 @@ import org.apache.calcite.sql2rel.StandardConvertletTable; import org.apache.shardingsphere.infra.database.core.type.DatabaseType; import org.apache.shardingsphere.parser.rule.SQLParserRule; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.view.ShardingSphereViewExpander; -import org.apache.shardingsphere.sqlfederation.compiler.planner.rule.converter.EnumerableScanConverterRule; -import org.apache.shardingsphere.sqlfederation.compiler.planner.rule.transformation.PushFilterIntoScanRule; -import org.apache.shardingsphere.sqlfederation.compiler.planner.rule.transformation.PushProjectIntoScanRule; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.view.ShardingSphereViewExpander; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.rule.converter.EnumerableScanConverterRule; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.rule.transformation.PushFilterIntoScanRule; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.rule.transformation.PushProjectIntoScanRule; import java.util.Arrays; import java.util.Collection; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLDialectFactory.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/sql/SQLDialectFactory.java similarity index 97% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLDialectFactory.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/sql/SQLDialectFactory.java index 311ed05823653..57388747d08cc 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/executor/SQLDialectFactory.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/sql/SQLDialectFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.executor; +package org.apache.shardingsphere.sqlfederation.optimizer.sql; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompiler.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompiler.java similarity index 88% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompiler.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompiler.java index a8673f42ac21b..751760b5e2635 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompiler.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompiler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.statement; +package org.apache.shardingsphere.sqlfederation.optimizer.statement; import lombok.RequiredArgsConstructor; import org.apache.calcite.adapter.enumerable.EnumerableConvention; @@ -27,10 +27,10 @@ import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql2rel.SqlToRelConverter; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; -import org.apache.shardingsphere.sqlfederation.compiler.SQLFederationExecutionPlan; -import org.apache.shardingsphere.sqlfederation.compiler.converter.SQLNodeConverterEngine; -import org.apache.shardingsphere.sqlfederation.compiler.operator.util.LogicalScanRelShuttle; -import org.apache.shardingsphere.sqlfederation.compiler.planner.util.SQLFederationPlannerUtils; +import org.apache.shardingsphere.sqlfederation.optimizer.SQLFederationExecutionPlan; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.SQLNodeConverterEngine; +import org.apache.shardingsphere.sqlfederation.optimizer.operator.util.LogicalScanRelShuttle; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.util.SQLFederationPlannerUtils; import java.util.Objects; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompilerEngine.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompilerEngine.java similarity index 83% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompilerEngine.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompilerEngine.java index 11e62341a1348..1cd8850cc28f8 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompilerEngine.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompilerEngine.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.statement; +package org.apache.shardingsphere.sqlfederation.optimizer.statement; import com.github.benmanes.caffeine.cache.LoadingCache; import org.apache.shardingsphere.sql.parser.api.CacheOption; -import org.apache.shardingsphere.sqlfederation.compiler.SQLFederationExecutionPlan; -import org.apache.shardingsphere.sqlfederation.compiler.planner.cache.ExecutionPlanCacheBuilder; -import org.apache.shardingsphere.sqlfederation.compiler.planner.cache.ExecutionPlanCacheKey; +import org.apache.shardingsphere.sqlfederation.optimizer.SQLFederationExecutionPlan; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.cache.ExecutionPlanCacheBuilder; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.cache.ExecutionPlanCacheKey; /** * SQL statement compiler engine. diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompilerEngineFactory.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompilerEngineFactory.java similarity index 96% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompilerEngineFactory.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompilerEngineFactory.java index 61e329018d07c..5609328adfc56 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statement/SQLStatementCompilerEngineFactory.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statement/SQLStatementCompilerEngineFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.statement; +package org.apache.shardingsphere.sqlfederation.optimizer.statement; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statistic/SQLFederationStatistic.java b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statistic/SQLFederationStatistic.java similarity index 95% rename from kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statistic/SQLFederationStatistic.java rename to kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statistic/SQLFederationStatistic.java index 7c82d31d772f6..ca8d57b53c389 100644 --- a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/compiler/statistic/SQLFederationStatistic.java +++ b/kernel/sql-federation/optimizer/src/main/java/org/apache/shardingsphere/sqlfederation/optimizer/statistic/SQLFederationStatistic.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.statistic; +package org.apache.shardingsphere.sqlfederation.optimizer.statistic; import org.apache.calcite.rel.RelCollation; import org.apache.calcite.rel.RelDistribution; diff --git a/kernel/sql-federation/core/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder b/kernel/sql-federation/optimizer/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder similarity index 52% rename from kernel/sql-federation/core/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder rename to kernel/sql-federation/optimizer/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder index fd9908a787e85..b69e9d0382127 100644 --- a/kernel/sql-federation/core/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.OptimizerSQLDialectBuilder +++ b/kernel/sql-federation/optimizer/src/main/resources/META-INF/services/org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilder @@ -15,10 +15,10 @@ # limitations under the License. # -org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl.H2OptimizerBuilder -org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl.MySQLOptimizerBuilder -org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl.PostgreSQLOptimizerBuilder -org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl.OpenGaussOptimizerBuilder -org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl.SQLServerOptimizerBuilder -org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl.OracleOptimizerBuilder -org.apache.shardingsphere.sqlfederation.compiler.context.parser.dialect.impl.SQL92OptimizerBuilder +org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl.H2OptimizerBuilder +org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl.MySQLOptimizerBuilder +org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl.PostgreSQLOptimizerBuilder +org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl.OpenGaussOptimizerBuilder +org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl.SQLServerOptimizerBuilder +org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl.OracleOptimizerBuilder +org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.impl.SQL92OptimizerBuilder diff --git a/kernel/sql-federation/core/src/main/resources/saffron.properties b/kernel/sql-federation/optimizer/src/main/resources/saffron.properties similarity index 100% rename from kernel/sql-federation/core/src/main/resources/saffron.properties rename to kernel/sql-federation/optimizer/src/main/resources/saffron.properties diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContextTest.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContextTest.java similarity index 91% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContextTest.java rename to kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContextTest.java index 86283a9c28628..796e072741ef3 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/context/OptimizerContextTest.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/context/OptimizerContextTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.context; +package org.apache.shardingsphere.sqlfederation.optimizer.context; import org.apache.shardingsphere.infra.config.props.ConfigurationProperties; import org.apache.shardingsphere.infra.database.core.DefaultDatabase; @@ -23,8 +23,8 @@ import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.apache.shardingsphere.parser.rule.SQLParserRule; -import org.apache.shardingsphere.sqlfederation.compiler.context.parser.OptimizerParserContext; -import org.apache.shardingsphere.sqlfederation.compiler.context.planner.OptimizerPlannerContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.OptimizerParserContext; +import org.apache.shardingsphere.sqlfederation.optimizer.context.planner.OptimizerPlannerContext; import org.junit.jupiter.api.Test; import java.util.Collections; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/CombineOperatorConverterTest.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverterTest.java similarity index 96% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/CombineOperatorConverterTest.java rename to kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverterTest.java index 4f5a3cd19e650..9cabffb6134e6 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/converter/type/CombineOperatorConverterTest.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/converter/type/CombineOperatorConverterTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.converter.type; +package org.apache.shardingsphere.sqlfederation.optimizer.converter.type; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.shardingsphere.sql.parser.sql.common.enums.CombineType; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/SQLStatementCompilerIT.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/SQLStatementCompilerIT.java similarity index 98% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/SQLStatementCompilerIT.java rename to kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/SQLStatementCompilerIT.java index d455bca90adb1..d90c558c1e6ee 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/SQLStatementCompilerIT.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/SQLStatementCompilerIT.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.it; +package org.apache.shardingsphere.sqlfederation.optimizer.it; import lombok.SneakyThrows; import org.apache.calcite.config.CalciteConnectionConfig; @@ -35,9 +35,9 @@ import org.apache.shardingsphere.parser.rule.SQLParserRule; import org.apache.shardingsphere.parser.rule.builder.DefaultSQLParserRuleConfigurationBuilder; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; -import org.apache.shardingsphere.sqlfederation.compiler.metadata.schema.SQLFederationSchema; -import org.apache.shardingsphere.sqlfederation.compiler.planner.util.SQLFederationPlannerUtils; -import org.apache.shardingsphere.sqlfederation.compiler.statement.SQLStatementCompiler; +import org.apache.shardingsphere.sqlfederation.optimizer.metadata.schema.SQLFederationSchema; +import org.apache.shardingsphere.sqlfederation.optimizer.planner.util.SQLFederationPlannerUtils; +import org.apache.shardingsphere.sqlfederation.optimizer.statement.SQLStatementCompiler; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.ParameterizedTest; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCase.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCase.java similarity index 95% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCase.java rename to kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCase.java index ada6c151bb35b..f6567cb8ca67b 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCase.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCase.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.it; +package org.apache.shardingsphere.sqlfederation.optimizer.it; import lombok.Getter; import lombok.Setter; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCaseAssertion.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCaseAssertion.java similarity index 95% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCaseAssertion.java rename to kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCaseAssertion.java index a2202266e8075..69ad3a1ee3d5e 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCaseAssertion.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCaseAssertion.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.it; +package org.apache.shardingsphere.sqlfederation.optimizer.it; import lombok.Getter; import lombok.Setter; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCases.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCases.java similarity index 95% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCases.java rename to kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCases.java index 07632a4a0f696..9ae8338a8c717 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCases.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCases.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.it; +package org.apache.shardingsphere.sqlfederation.optimizer.it; import lombok.Getter; diff --git a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCasesLoader.java b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCasesLoader.java similarity index 97% rename from kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCasesLoader.java rename to kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCasesLoader.java index a31d1da7ad486..3b10c44681e58 100644 --- a/kernel/sql-federation/core/src/test/java/org/apache/shardingsphere/sqlfederation/compiler/it/TestCasesLoader.java +++ b/kernel/sql-federation/optimizer/src/test/java/org/apache/shardingsphere/sqlfederation/optimizer/it/TestCasesLoader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.sqlfederation.compiler.it; +package org.apache.shardingsphere.sqlfederation.optimizer.it; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; diff --git a/kernel/sql-federation/core/src/test/resources/cases/federation-query-sql-cases.xml b/kernel/sql-federation/optimizer/src/test/resources/cases/federation-query-sql-cases.xml similarity index 100% rename from kernel/sql-federation/core/src/test/resources/cases/federation-query-sql-cases.xml rename to kernel/sql-federation/optimizer/src/test/resources/cases/federation-query-sql-cases.xml diff --git a/kernel/sql-federation/optimizer/src/test/resources/logback-test.xml b/kernel/sql-federation/optimizer/src/test/resources/logback-test.xml new file mode 100644 index 0000000000000..d90fc4a715683 --- /dev/null +++ b/kernel/sql-federation/optimizer/src/test/resources/logback-test.xml @@ -0,0 +1,33 @@ + + + + + + + [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n + + + + + + + + + + + diff --git a/kernel/sql-federation/pom.xml b/kernel/sql-federation/pom.xml index 12538564638b8..bc3a8f2b18091 100644 --- a/kernel/sql-federation/pom.xml +++ b/kernel/sql-federation/pom.xml @@ -31,5 +31,7 @@ api core distsql + optimizer + executor diff --git a/test/it/optimizer/src/test/java/org/apache/shardingsphere/test/it/optimizer/converter/SQLNodeConverterEngineIT.java b/test/it/optimizer/src/test/java/org/apache/shardingsphere/test/it/optimizer/converter/SQLNodeConverterEngineIT.java index 55a6b0f89e730..e8334788fafd4 100644 --- a/test/it/optimizer/src/test/java/org/apache/shardingsphere/test/it/optimizer/converter/SQLNodeConverterEngineIT.java +++ b/test/it/optimizer/src/test/java/org/apache/shardingsphere/test/it/optimizer/converter/SQLNodeConverterEngineIT.java @@ -22,8 +22,8 @@ import org.apache.shardingsphere.sql.parser.api.SQLParserEngine; import org.apache.shardingsphere.sql.parser.api.SQLStatementVisitorEngine; import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement; -import org.apache.shardingsphere.sqlfederation.compiler.converter.SQLNodeConverterEngine; -import org.apache.shardingsphere.sqlfederation.executor.SQLDialectFactory; +import org.apache.shardingsphere.sqlfederation.optimizer.converter.SQLNodeConverterEngine; +import org.apache.shardingsphere.sqlfederation.optimizer.sql.SQLDialectFactory; import org.apache.shardingsphere.test.it.optimizer.converter.cases.SQLNodeConverterTestCases; import org.apache.shardingsphere.test.it.optimizer.converter.cases.SQLNodeConverterTestCasesRegistry; import org.apache.shardingsphere.test.it.sql.parser.internal.InternalSQLParserTestParameter;