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