This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new d3f7e64ba98 Move pipeline h2 into it module (#29446)
d3f7e64ba98 is described below
commit d3f7e64ba98fc885df8299ef80a94c935298faf3
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Dec 19 16:17:20 2023 +0800
Move pipeline h2 into it module (#29446)
* For code format
* Move pipeline h2 into it module
---
kernel/data-pipeline/dialect/h2/pom.xml | 36 ----------------------
...core.spi.ingest.dumper.IncrementalDumperCreator | 18 -----------
kernel/data-pipeline/dialect/pom.xml | 1 -
.../handler/distsql/rul/sql/PreviewExecutor.java | 3 +-
.../prepare/MySQLComStmtPrepareExecutor.java | 3 +-
test/it/pipeline/pom.xml | 5 ---
.../datasource/H2JdbcQueryPropertiesExtension.java | 2 +-
.../h2}/dumper/H2IncrementalDumperCreator.java | 2 +-
.../h2/query/H2JDBCStreamQueryBuilder.java | 2 +-
.../h2/sqlbuilder/H2PipelineSQLBuilder.java | 2 +-
...peline.core.query.DialectJDBCStreamQueryBuilder | 2 +-
...core.spi.ingest.dumper.IncrementalDumperCreator | 1 +
...pipeline.core.spi.sql.DialectPipelineSQLBuilder | 2 +-
....data.pipeline.spi.JdbcQueryPropertiesExtension | 2 +-
14 files changed, 12 insertions(+), 69 deletions(-)
diff --git a/kernel/data-pipeline/dialect/h2/pom.xml
b/kernel/data-pipeline/dialect/h2/pom.xml
deleted file mode 100644
index 205283b5a62..00000000000
--- a/kernel/data-pipeline/dialect/h2/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-data-pipeline-dialect</artifactId>
- <version>5.4.2-SNAPSHOT</version>
- </parent>
- <artifactId>shardingsphere-data-pipeline-h2</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-data-pipeline-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.ingest.dumper.IncrementalDumperCreator
b/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.ingest.dumper.IncrementalDumperCreator
deleted file mode 100644
index 794fba8f92a..00000000000
---
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.ingest.dumper.IncrementalDumperCreator
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# 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.
-#
-
-org.apache.shardingsphere.data.pipeline.h2.ingest.dumper.H2IncrementalDumperCreator
diff --git a/kernel/data-pipeline/dialect/pom.xml
b/kernel/data-pipeline/dialect/pom.xml
index db7855a1cf9..83a8e5e4d28 100644
--- a/kernel/data-pipeline/dialect/pom.xml
+++ b/kernel/data-pipeline/dialect/pom.xml
@@ -31,6 +31,5 @@
<module>mysql</module>
<module>postgresql</module>
<module>opengauss</module>
- <module>h2</module>
</modules>
</project>
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewExecutor.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewExecutor.java
index 397f2b9cd3b..0689631d503 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewExecutor.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/rul/sql/PreviewExecutor.java
@@ -94,7 +94,8 @@ public final class PreviewExecutor implements
ConnectionSessionRequiredRULExecut
SQLParserRule sqlParserRule =
globalRuleMetaData.getSingleRule(SQLParserRule.class);
String sql = sqlParserRule.isSqlCommentParseEnabled() ?
sqlStatement.getSql() : SQLHintUtils.removeHint(sqlStatement.getSql());
HintValueContext hintValueContext =
sqlParserRule.isSqlCommentParseEnabled() ? new HintValueContext() :
SQLHintUtils.extractHint(sqlStatement.getSql()).orElseGet(HintValueContext::new);
- SQLStatement previewedStatement =
sqlParserRule.getSQLParserEngine(metaDataContexts.getMetaData().getDatabase(databaseName).getProtocolType()).parse(sql,
false);
+ DatabaseType databaseType =
metaDataContexts.getMetaData().getDatabase(databaseName).getProtocolType();
+ SQLStatement previewedStatement =
sqlParserRule.getSQLParserEngine(databaseType).parse(sql, false);
SQLStatementContext sqlStatementContext = new
SQLBindEngine(metaDataContexts.getMetaData(), databaseName,
hintValueContext).bind(previewedStatement, Collections.emptyList());
QueryContext queryContext = new QueryContext(sqlStatementContext, sql,
Collections.emptyList(), hintValueContext);
connectionSession.setQueryContext(queryContext);
diff --git
a/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
b/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
index 57d32332ccd..ee174ed6857 100644
---
a/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
+++
b/proxy/frontend/type/mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
@@ -79,7 +79,8 @@ public final class MySQLComStmtPrepareExecutor implements
CommandExecutor {
failedIfContainsMultiStatements();
MetaDataContexts metaDataContexts =
ProxyContext.getInstance().getContextManager().getMetaDataContexts();
SQLParserRule sqlParserRule =
metaDataContexts.getMetaData().getGlobalRuleMetaData().getSingleRule(SQLParserRule.class);
- SQLStatement sqlStatement =
sqlParserRule.getSQLParserEngine(TypedSPILoader.getService(DatabaseType.class,
"MySQL")).parse(packet.getSQL(), true);
+ DatabaseType databaseType =
TypedSPILoader.getService(DatabaseType.class, "MySQL");
+ SQLStatement sqlStatement =
sqlParserRule.getSQLParserEngine(databaseType).parse(packet.getSQL(), true);
if (!MySQLComStmtPrepareChecker.isAllowedStatement(sqlStatement)) {
throw new UnsupportedPreparedStatementException();
}
diff --git a/test/it/pipeline/pom.xml b/test/it/pipeline/pom.xml
index 05e50c3451c..1a79511899f 100644
--- a/test/it/pipeline/pom.xml
+++ b/test/it/pipeline/pom.xml
@@ -42,11 +42,6 @@
<artifactId>shardingsphere-data-pipeline-opengauss</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-data-pipeline-h2</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-data-pipeline-scenario-migration</artifactId>
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/datasource/H2JdbcQueryPropertiesExtension.java
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/datasource/H2JdbcQueryPropertiesExtension.java
similarity index 94%
rename from
kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/datasource/H2JdbcQueryPropertiesExtension.java
rename to
test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/datasource/H2JdbcQueryPropertiesExtension.java
index 445e2b339fa..2ea976ed351 100644
---
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/datasource/H2JdbcQueryPropertiesExtension.java
+++
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/datasource/H2JdbcQueryPropertiesExtension.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.data.pipeline.h2.datasource;
+package org.apache.shardingsphere.test.it.data.pipeline.h2.datasource;
import
org.apache.shardingsphere.data.pipeline.spi.JdbcQueryPropertiesExtension;
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/ingest/dumper/H2IncrementalDumperCreator.java
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/dumper/H2IncrementalDumperCreator.java
similarity index 96%
rename from
kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/ingest/dumper/H2IncrementalDumperCreator.java
rename to
test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/dumper/H2IncrementalDumperCreator.java
index ccde2116cdf..caddcedf3ce 100644
---
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/ingest/dumper/H2IncrementalDumperCreator.java
+++
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/dumper/H2IncrementalDumperCreator.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.data.pipeline.h2.ingest.dumper;
+package org.apache.shardingsphere.test.it.data.pipeline.h2.dumper;
import
org.apache.shardingsphere.data.pipeline.core.ingest.dumper.context.IncrementalDumperContext;
import
org.apache.shardingsphere.data.pipeline.core.ingest.channel.PipelineChannel;
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/query/H2JDBCStreamQueryBuilder.java
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/query/H2JDBCStreamQueryBuilder.java
similarity index 95%
rename from
kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/query/H2JDBCStreamQueryBuilder.java
rename to
test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/query/H2JDBCStreamQueryBuilder.java
index c383bb5b672..095cc8af6f9 100644
---
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/query/H2JDBCStreamQueryBuilder.java
+++
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/query/H2JDBCStreamQueryBuilder.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.data.pipeline.h2.query;
+package org.apache.shardingsphere.test.it.data.pipeline.h2.query;
import
org.apache.shardingsphere.data.pipeline.core.query.DialectJDBCStreamQueryBuilder;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/sqlbuilder/H2PipelineSQLBuilder.java
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/sqlbuilder/H2PipelineSQLBuilder.java
similarity index 94%
rename from
kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/sqlbuilder/H2PipelineSQLBuilder.java
rename to
test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/sqlbuilder/H2PipelineSQLBuilder.java
index 5acee039454..5780cd6f380 100644
---
a/kernel/data-pipeline/dialect/h2/src/main/java/org/apache/shardingsphere/data/pipeline/h2/sqlbuilder/H2PipelineSQLBuilder.java
+++
b/test/it/pipeline/src/test/java/org/apache/shardingsphere/test/it/data/pipeline/h2/sqlbuilder/H2PipelineSQLBuilder.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.data.pipeline.h2.sqlbuilder;
+package org.apache.shardingsphere.test.it.data.pipeline.h2.sqlbuilder;
import
org.apache.shardingsphere.data.pipeline.core.spi.sql.DialectPipelineSQLBuilder;
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.query.DialectJDBCStreamQueryBuilder
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.query.DialectJDBCStreamQueryBuilder
similarity index 90%
rename from
kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.query.DialectJDBCStreamQueryBuilder
rename to
test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.query.DialectJDBCStreamQueryBuilder
index 3b0b244e370..5c7e1bda537 100644
---
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.query.DialectJDBCStreamQueryBuilder
+++
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.query.DialectJDBCStreamQueryBuilder
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.data.pipeline.h2.query.H2JDBCStreamQueryBuilder
+org.apache.shardingsphere.test.it.data.pipeline.h2.query.H2JDBCStreamQueryBuilder
diff --git
a/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.ingest.dumper.IncrementalDumperCreator
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.ingest.dumper.IncrementalDumperCreator
index d545f3727a5..f0a701d1e03 100644
---
a/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.ingest.dumper.IncrementalDumperCreator
+++
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.ingest.dumper.IncrementalDumperCreator
@@ -16,3 +16,4 @@
#
org.apache.shardingsphere.test.it.data.pipeline.core.fixture.FixtureIncrementalDumperCreator
+org.apache.shardingsphere.test.it.data.pipeline.h2.dumper.H2IncrementalDumperCreator
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.sql.DialectPipelineSQLBuilder
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.sql.DialectPipelineSQLBuilder
similarity index 90%
rename from
kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.sql.DialectPipelineSQLBuilder
rename to
test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.sql.DialectPipelineSQLBuilder
index 525cc3bb507..c4428dae026 100644
---
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.sql.DialectPipelineSQLBuilder
+++
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.core.spi.sql.DialectPipelineSQLBuilder
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.data.pipeline.h2.sqlbuilder.H2PipelineSQLBuilder
+org.apache.shardingsphere.test.it.data.pipeline.h2.sqlbuilder.H2PipelineSQLBuilder
diff --git
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.JdbcQueryPropertiesExtension
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.JdbcQueryPropertiesExtension
similarity index 89%
rename from
kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.JdbcQueryPropertiesExtension
rename to
test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.JdbcQueryPropertiesExtension
index 4fa145a03b2..378f8cb196d 100644
---
a/kernel/data-pipeline/dialect/h2/src/main/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.JdbcQueryPropertiesExtension
+++
b/test/it/pipeline/src/test/resources/META-INF/services/org.apache.shardingsphere.data.pipeline.spi.JdbcQueryPropertiesExtension
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.data.pipeline.h2.datasource.H2JdbcQueryPropertiesExtension
+org.apache.shardingsphere.test.it.data.pipeline.h2.datasource.H2JdbcQueryPropertiesExtension