You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2020/11/28 12:14:03 UTC
[shardingsphere] branch master updated: Rename QueryResult &
UpdateResult (#8398)
This is an automated email from the ASF dual-hosted git repository.
menghaoran 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 2409209 Rename QueryResult & UpdateResult (#8398)
2409209 is described below
commit 240920940faa05e33f8734bef9103a7f02aa62f9
Author: Liang Zhang <te...@163.com>
AuthorDate: Sat Nov 28 20:13:42 2020 +0800
Rename QueryResult & UpdateResult (#8398)
* Rename UpdateResult
* Rename QueryResult
---
.../merge/dal/EncryptDALResultDecorator.java | 4 +--
.../dal/impl/MergedEncryptColumnsMergedResult.java | 6 ++--
.../merge/dql/EncryptDQLResultDecorator.java | 4 +--
.../merge/dal/EncryptDALResultDecoratorTest.java | 8 ++---
.../dal/MergedEncryptColumnsMergedResultTest.java | 6 ++--
.../merge/dql/EncryptDQLResultDecoratorTest.java | 4 +--
.../merge/dal/ShardingDALResultMerger.java | 4 +--
.../merge/dal/show/LogicTablesMergedResult.java | 8 ++---
.../dal/show/ShowCreateTableMergedResult.java | 4 +--
.../merge/dql/ShardingDQLResultMerger.java | 12 +++----
.../dql/groupby/GroupByMemoryMergedResult.java | 18 +++++------
.../dql/groupby/GroupByStreamMergedResult.java | 4 +--
.../sharding/merge/dql/groupby/GroupByValue.java | 6 ++--
.../dql/iterator/IteratorStreamMergedResult.java | 6 ++--
.../dql/orderby/OrderByStreamMergedResult.java | 8 ++---
.../sharding/merge/dql/orderby/OrderByValue.java | 6 ++--
.../merge/dal/ShardingDALResultMergerTest.java | 6 ++--
.../dal/show/ShowCreateTableMergedResultTest.java | 6 ++--
.../merge/dal/show/ShowTablesMergedResultTest.java | 6 ++--
.../merge/dql/ShardingDQLResultMergerTest.java | 18 +++++------
.../dql/groupby/GroupByMemoryMergedResultTest.java | 18 +++++------
.../dql/groupby/GroupByRowComparatorTest.java | 6 ++--
.../dql/groupby/GroupByStreamMergedResultTest.java | 18 +++++------
.../merge/dql/groupby/GroupByValueTest.java | 4 +--
.../iterator/IteratorStreamMergedResultTest.java | 18 +++++------
.../dql/orderby/OrderByStreamMergedResultTest.java | 12 +++----
.../merge/dql/orderby/OrderByValueTest.java | 18 +++++------
.../pagination/LimitDecoratorMergedResultTest.java | 6 ++--
.../RowNumberDecoratorMergedResultTest.java | 6 ++--
.../TopAndRowNumberDecoratorMergedResultTest.java | 6 ++--
.../sql/execute/engine/raw/RawExecutor.java | 12 +++----
.../{ExecuteQueryResult.java => QueryResult.java} | 12 +++----
.../result/query/jdbc/AbstractJDBCQueryResult.java | 4 +--
.../execute/result/query/raw/RawQueryResult.java | 4 +--
...{ExecuteUpdateResult.java => UpdateResult.java} | 4 +--
.../sql/execute/engine/raw/RawExecutorTest.java | 24 +++++++-------
.../shardingsphere/infra/merge/MergeEngine.java | 8 ++---
.../merge/engine/decorator/ResultDecorator.java | 4 +--
.../decorator/impl/TransparentResultDecorator.java | 4 +--
.../infra/merge/engine/merger/ResultMerger.java | 4 +--
.../merger/impl/TransparentResultMerger.java | 4 +--
.../result/impl/memory/MemoryMergedResult.java | 6 ++--
.../result/impl/memory/MemoryQueryResultRow.java | 6 ++--
.../result/impl/stream/StreamMergedResult.java | 6 ++--
.../impl/transparent/TransparentMergedResult.java | 4 +--
.../infra/merge/MergeEngineTest.java | 4 +--
.../impl/TransparentResultDecoratorTest.java | 4 +--
.../merger/impl/TransparentResultMergerTest.java | 4 +--
.../fixture/decorator/ResultDecoratorFixture.java | 4 +--
.../merge/fixture/merger/ResultMergerFixture.java | 6 ++--
.../impl/memory/MemoryQueryResultRowTest.java | 4 +--
.../memory/fixture/TestMemoryMergedResult.java | 4 +--
.../result/impl/stream/StreamMergedResultTest.java | 10 +++---
.../transparent/TransparentMergedResultTest.java | 12 +++----
.../driver/executor/AbstractStatementExecutor.java | 4 +--
.../driver/executor/PreparedStatementExecutor.java | 14 ++++----
.../driver/executor/StatementExecutor.java | 10 +++---
.../statement/ShardingSpherePreparedStatement.java | 10 +++---
.../core/statement/ShardingSphereStatement.java | 10 +++---
.../executor/PreparedStatementExecutorTest.java | 10 +++---
.../driver/executor/StatementExecutorTest.java | 10 +++---
.../jdbc/JDBCDatabaseCommunicationEngine.java | 4 +--
.../execute/engine/jdbc/JDBCExecuteEngine.java | 12 +++----
.../engine/jdbc/ProxyJDBCExecutorCallback.java | 8 ++---
.../jdbc/execute/engine/jdbc/RawProxyExecutor.java | 6 ++--
.../backend/response/query/QueryHeaderBuilder.java | 37 +++++++++++-----------
.../backend/response/query/QueryResponse.java | 4 +--
.../backend/response/update/UpdateResponse.java | 8 ++---
.../text/admin/ShowTablesBackendHandler.java | 4 +--
.../response/query/QueryHeaderBuilderTest.java | 32 +++++++++----------
.../binary/bind/PostgreSQLComBindExecutor.java | 4 +--
.../query/text/PostgreSQLComQueryExecutor.java | 4 +--
72 files changed, 302 insertions(+), 303 deletions(-)
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecorator.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecorator.java
index 2169c15..afab4ef 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecorator.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecorator.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.encrypt.merge.dal.impl.DecoratedEncryptColumnsM
import org.apache.shardingsphere.encrypt.merge.dal.impl.MergedEncryptColumnsMergedResult;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecorator;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
@@ -35,7 +35,7 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQ
public final class EncryptDALResultDecorator implements ResultDecorator<EncryptRule> {
@Override
- public MergedResult decorate(final ExecuteQueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final EncryptRule rule) {
+ public MergedResult decorate(final QueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final EncryptRule rule) {
return isNeedMergeEncryptColumns(sqlStatementContext.getSqlStatement())
? new MergedEncryptColumnsMergedResult(queryResult, sqlStatementContext, rule) : new TransparentMergedResult(queryResult);
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/impl/MergedEncryptColumnsMergedResult.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/impl/MergedEncryptColumnsMergedResult.java
index ebe8f88..09ec0e5 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/impl/MergedEncryptColumnsMergedResult.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dal/impl/MergedEncryptColumnsMergedResult.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.encrypt.merge.dal.impl;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import java.sql.SQLException;
@@ -28,9 +28,9 @@ import java.sql.SQLException;
*/
public final class MergedEncryptColumnsMergedResult extends EncryptColumnsMergedResult {
- private final ExecuteQueryResult queryResult;
+ private final QueryResult queryResult;
- public MergedEncryptColumnsMergedResult(final ExecuteQueryResult queryResult, final SQLStatementContext sqlStatementContext, final EncryptRule encryptRule) {
+ public MergedEncryptColumnsMergedResult(final QueryResult queryResult, final SQLStatementContext sqlStatementContext, final EncryptRule encryptRule) {
super(sqlStatementContext, encryptRule);
this.queryResult = queryResult;
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecorator.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecorator.java
index eca16da..2ae55a6 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecorator.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/main/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecorator.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.encrypt.merge.dql;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecorator;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
@@ -36,7 +36,7 @@ public final class EncryptDQLResultDecorator implements ResultDecorator<EncryptR
private final boolean queryWithCipherColumn;
@Override
- public MergedResult decorate(final ExecuteQueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final EncryptRule rule) {
+ public MergedResult decorate(final QueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final EncryptRule rule) {
return new EncryptMergedResult(metaData, new TransparentMergedResult(queryResult), queryWithCipherColumn);
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecoratorTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecoratorTest.java
index 67091ef..ed11b42 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecoratorTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/EncryptDALResultDecoratorTest.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.binder.statement.dal.DescribeStatementContext;
import org.apache.shardingsphere.infra.binder.statement.dal.ShowColumnsStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
@@ -56,7 +56,7 @@ public final class EncryptDALResultDecoratorTest {
public void assertMergedResultWithDescribeStatement() {
sqlStatementContext = getDescribeStatementContext();
EncryptDALResultDecorator encryptDALResultDecorator = new EncryptDALResultDecorator();
- assertThat(encryptDALResultDecorator.decorate(mock(ExecuteQueryResult.class), sqlStatementContext, rule), instanceOf(MergedEncryptColumnsMergedResult.class));
+ assertThat(encryptDALResultDecorator.decorate(mock(QueryResult.class), sqlStatementContext, rule), instanceOf(MergedEncryptColumnsMergedResult.class));
assertThat(encryptDALResultDecorator.decorate(mock(MergedResult.class), sqlStatementContext, rule), instanceOf(DecoratedEncryptColumnsMergedResult.class));
}
@@ -64,7 +64,7 @@ public final class EncryptDALResultDecoratorTest {
public void assertMergedResultWithShowColumnsStatement() {
sqlStatementContext = getShowColumnsStatementContext();
EncryptDALResultDecorator encryptDALResultDecorator = new EncryptDALResultDecorator();
- assertThat(encryptDALResultDecorator.decorate(mock(ExecuteQueryResult.class), sqlStatementContext, rule), instanceOf(MergedEncryptColumnsMergedResult.class));
+ assertThat(encryptDALResultDecorator.decorate(mock(QueryResult.class), sqlStatementContext, rule), instanceOf(MergedEncryptColumnsMergedResult.class));
assertThat(encryptDALResultDecorator.decorate(mock(MergedResult.class), sqlStatementContext, rule), instanceOf(DecoratedEncryptColumnsMergedResult.class));
}
@@ -72,7 +72,7 @@ public final class EncryptDALResultDecoratorTest {
public void assertMergedResultWithOtherStatement() {
sqlStatementContext = mock(SQLStatementContext.class);
EncryptDALResultDecorator encryptDALResultDecorator = new EncryptDALResultDecorator();
- assertThat(encryptDALResultDecorator.decorate(mock(ExecuteQueryResult.class), sqlStatementContext, rule), instanceOf(TransparentMergedResult.class));
+ assertThat(encryptDALResultDecorator.decorate(mock(QueryResult.class), sqlStatementContext, rule), instanceOf(TransparentMergedResult.class));
assertThat(encryptDALResultDecorator.decorate(mock(MergedResult.class), sqlStatementContext, rule), instanceOf(MergedResult.class));
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/MergedEncryptColumnsMergedResultTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/MergedEncryptColumnsMergedResultTest.java
index 26f7cb0..909f29c 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/MergedEncryptColumnsMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dal/MergedEncryptColumnsMergedResultTest.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.encrypt.merge.dal.impl.MergedEncryptColumnsMerg
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.encrypt.rule.EncryptTable;
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
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.sql.parser.sql.common.value.identifier.IdentifierValue;
@@ -45,7 +45,7 @@ import static org.mockito.Mockito.when;
public final class MergedEncryptColumnsMergedResultTest {
@Mock
- private ExecuteQueryResult queryResult;
+ private QueryResult queryResult;
@Test
public void assertNextWithNotHasNext() throws SQLException {
@@ -98,7 +98,7 @@ public final class MergedEncryptColumnsMergedResultTest {
assertFalse(createMergedEncryptColumnsMergedResult(queryResult, mock(EncryptRule.class)).wasNull());
}
- private MergedEncryptColumnsMergedResult createMergedEncryptColumnsMergedResult(final ExecuteQueryResult queryResult, final EncryptRule encryptRule) {
+ private MergedEncryptColumnsMergedResult createMergedEncryptColumnsMergedResult(final QueryResult queryResult, final EncryptRule encryptRule) {
SelectStatementContext sqlStatementContext = mock(SelectStatementContext.class);
IdentifierValue identifierValue = new IdentifierValue("test");
TableNameSegment tableNameSegment = new TableNameSegment(1, 4, identifierValue);
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecoratorTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecoratorTest.java
index 5a28be5..a26df63 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecoratorTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-merge/src/test/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptDQLResultDecoratorTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.encrypt.merge.dql;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.junit.Test;
@@ -33,7 +33,7 @@ public final class EncryptDQLResultDecoratorTest {
@Test
public void assertDecorateQueryResult() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.next()).thenReturn(true);
EncryptDQLResultDecorator decorator = new EncryptDQLResultDecorator(mock(EncryptAlgorithmMetaData.class), false);
MergedResult actual = decorator.decorate(queryResult, mock(SQLStatementContext.class), mock(EncryptRule.class));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMerger.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMerger.java
index eed23f5..b128832 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMerger.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMerger.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.merge.dal;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.database.DefaultSchema;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.merger.ResultMerger;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
@@ -49,7 +49,7 @@ public final class ShardingDALResultMerger implements ResultMerger {
private final ShardingRule shardingRule;
@Override
- public MergedResult merge(final List<ExecuteQueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) throws SQLException {
+ public MergedResult merge(final List<QueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) throws SQLException {
SQLStatement dalStatement = sqlStatementContext.getSqlStatement();
if (dalStatement instanceof MySQLShowDatabasesStatement) {
return new SingleLocalDataMergedResult(Collections.singletonList(DefaultSchema.LOGIC_NAME));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/LogicTablesMergedResult.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/LogicTablesMergedResult.java
index c11a6fa..518eb0c 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/LogicTablesMergedResult.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/LogicTablesMergedResult.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryMergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryQueryResultRow;
@@ -38,16 +38,16 @@ import java.util.Set;
public class LogicTablesMergedResult extends MemoryMergedResult<ShardingRule> {
public LogicTablesMergedResult(final ShardingRule shardingRule,
- final SQLStatementContext sqlStatementContext, final ShardingSphereSchema schema, final List<ExecuteQueryResult> queryResults) throws SQLException {
+ final SQLStatementContext sqlStatementContext, final ShardingSphereSchema schema, final List<QueryResult> queryResults) throws SQLException {
super(shardingRule, schema, sqlStatementContext, queryResults);
}
@Override
protected final List<MemoryQueryResultRow> init(final ShardingRule shardingRule, final ShardingSphereSchema schema,
- final SQLStatementContext sqlStatementContext, final List<ExecuteQueryResult> queryResults) throws SQLException {
+ final SQLStatementContext sqlStatementContext, final List<QueryResult> queryResults) throws SQLException {
List<MemoryQueryResultRow> result = new LinkedList<>();
Set<String> tableNames = new HashSet<>();
- for (ExecuteQueryResult each : queryResults) {
+ for (QueryResult each : queryResults) {
while (each.next()) {
MemoryQueryResultRow memoryResultSetRow = new MemoryQueryResultRow(each);
String actualTableName = memoryResultSetRow.getCell(1).toString();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResult.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResult.java
index 82f05fc..847802d 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResult.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResult.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sharding.merge.dal.show;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryQueryResultRow;
import java.sql.SQLException;
@@ -32,7 +32,7 @@ import java.util.List;
public final class ShowCreateTableMergedResult extends LogicTablesMergedResult {
public ShowCreateTableMergedResult(final ShardingRule shardingRule,
- final SQLStatementContext sqlStatementContext, final ShardingSphereSchema schema, final List<ExecuteQueryResult> queryResults) throws SQLException {
+ final SQLStatementContext sqlStatementContext, final ShardingSphereSchema schema, final List<QueryResult> queryResults) throws SQLException {
super(shardingRule, sqlStatementContext, schema, queryResults);
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
index f4c006a..10efc71 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
@@ -35,7 +35,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtil;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.merger.ResultMerger;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
@@ -53,7 +53,7 @@ public final class ShardingDQLResultMerger implements ResultMerger {
private final DatabaseType databaseType;
@Override
- public MergedResult merge(final List<ExecuteQueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) throws SQLException {
+ public MergedResult merge(final List<QueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) throws SQLException {
if (1 == queryResults.size()) {
return new IteratorStreamMergedResult(queryResults);
}
@@ -64,7 +64,7 @@ public final class ShardingDQLResultMerger implements ResultMerger {
return decorate(queryResults, selectStatementContext, mergedResult);
}
- private Map<String, Integer> getColumnLabelIndexMap(final ExecuteQueryResult queryResult) throws SQLException {
+ private Map<String, Integer> getColumnLabelIndexMap(final QueryResult queryResult) throws SQLException {
Map<String, Integer> result = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
for (int i = queryResult.getColumnCount(); i > 0; i--) {
result.put(SQLUtil.getExactlyValue(queryResult.getColumnLabel(i)), i);
@@ -72,7 +72,7 @@ public final class ShardingDQLResultMerger implements ResultMerger {
return result;
}
- private MergedResult build(final List<ExecuteQueryResult> queryResults, final SelectStatementContext selectStatementContext,
+ private MergedResult build(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext,
final Map<String, Integer> columnLabelIndexMap, final ShardingSphereSchema schema) throws SQLException {
if (isNeedProcessGroupBy(selectStatementContext)) {
return getGroupByMergedResult(queryResults, selectStatementContext, columnLabelIndexMap, schema);
@@ -103,7 +103,7 @@ public final class ShardingDQLResultMerger implements ResultMerger {
}
}
- private MergedResult getGroupByMergedResult(final List<ExecuteQueryResult> queryResults, final SelectStatementContext selectStatementContext,
+ private MergedResult getGroupByMergedResult(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext,
final Map<String, Integer> columnLabelIndexMap, final ShardingSphereSchema schema) throws SQLException {
return selectStatementContext.isSameGroupByAndOrderByItems()
? new GroupByStreamMergedResult(columnLabelIndexMap, queryResults, selectStatementContext, schema)
@@ -114,7 +114,7 @@ public final class ShardingDQLResultMerger implements ResultMerger {
return !selectStatementContext.getOrderByContext().getItems().isEmpty();
}
- private MergedResult decorate(final List<ExecuteQueryResult> queryResults, final SelectStatementContext selectStatementContext, final MergedResult mergedResult) throws SQLException {
+ private MergedResult decorate(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final MergedResult mergedResult) throws SQLException {
PaginationContext paginationContext = selectStatementContext.getPaginationContext();
if (!paginationContext.isHasPagination() || 1 == queryResults.size()) {
return mergedResult;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
index df3b286..eff0903 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sharding.merge.dql.groupby;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryMergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryQueryResultRow;
import org.apache.shardingsphere.sharding.merge.dql.groupby.aggregation.AggregationUnit;
@@ -51,17 +51,17 @@ import java.util.Map.Entry;
*/
public final class GroupByMemoryMergedResult extends MemoryMergedResult<ShardingRule> {
- public GroupByMemoryMergedResult(final List<ExecuteQueryResult> queryResults, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
+ public GroupByMemoryMergedResult(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
super(null, schema, selectStatementContext, queryResults);
}
@Override
protected List<MemoryQueryResultRow> init(final ShardingRule shardingRule,
- final ShardingSphereSchema schema, final SQLStatementContext sqlStatementContext, final List<ExecuteQueryResult> queryResults) throws SQLException {
+ final ShardingSphereSchema schema, final SQLStatementContext sqlStatementContext, final List<QueryResult> queryResults) throws SQLException {
SelectStatementContext selectStatementContext = (SelectStatementContext) sqlStatementContext;
Map<GroupByValue, MemoryQueryResultRow> dataMap = new HashMap<>(1024);
Map<GroupByValue, Map<AggregationProjection, AggregationUnit>> aggregationMap = new HashMap<>(1024);
- for (ExecuteQueryResult each : queryResults) {
+ for (QueryResult each : queryResults) {
while (each.next()) {
GroupByValue groupByValue = new GroupByValue(each, selectStatementContext.getGroupByContext().getItems());
initForFirstGroupByValue(selectStatementContext, each, groupByValue, dataMap, aggregationMap);
@@ -73,7 +73,7 @@ public final class GroupByMemoryMergedResult extends MemoryMergedResult<Sharding
return getMemoryResultSetRows(selectStatementContext, dataMap, valueCaseSensitive);
}
- private void initForFirstGroupByValue(final SelectStatementContext selectStatementContext, final ExecuteQueryResult queryResult,
+ private void initForFirstGroupByValue(final SelectStatementContext selectStatementContext, final QueryResult queryResult,
final GroupByValue groupByValue, final Map<GroupByValue, MemoryQueryResultRow> dataMap,
final Map<GroupByValue, Map<AggregationProjection, AggregationUnit>> aggregationMap) throws SQLException {
if (!dataMap.containsKey(groupByValue)) {
@@ -86,7 +86,7 @@ public final class GroupByMemoryMergedResult extends MemoryMergedResult<Sharding
}
}
- private void aggregate(final SelectStatementContext selectStatementContext, final ExecuteQueryResult queryResult,
+ private void aggregate(final SelectStatementContext selectStatementContext, final QueryResult queryResult,
final GroupByValue groupByValue, final Map<GroupByValue, Map<AggregationProjection, AggregationUnit>> aggregationMap) throws SQLException {
for (AggregationProjection each : selectStatementContext.getProjectionsContext().getAggregationProjections()) {
List<Comparable<?>> values = new ArrayList<>(2);
@@ -101,7 +101,7 @@ public final class GroupByMemoryMergedResult extends MemoryMergedResult<Sharding
}
}
- private Comparable<?> getAggregationValue(final ExecuteQueryResult queryResult, final AggregationProjection aggregationProjection) throws SQLException {
+ private Comparable<?> getAggregationValue(final QueryResult queryResult, final AggregationProjection aggregationProjection) throws SQLException {
Object result = queryResult.getValue(aggregationProjection.getIndex(), Object.class);
Preconditions.checkState(null == result || result instanceof Comparable, "Aggregation value must implements Comparable");
return (Comparable<?>) result;
@@ -116,7 +116,7 @@ public final class GroupByMemoryMergedResult extends MemoryMergedResult<Sharding
}
}
- private List<Boolean> getValueCaseSensitive(final ExecuteQueryResult queryResult, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
+ private List<Boolean> getValueCaseSensitive(final QueryResult queryResult, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
List<Boolean> result = Lists.newArrayList(false);
for (int columnIndex = 1; columnIndex <= queryResult.getColumnCount(); columnIndex++) {
result.add(getValueCaseSensitiveFromTables(queryResult, selectStatementContext, schema, columnIndex));
@@ -124,7 +124,7 @@ public final class GroupByMemoryMergedResult extends MemoryMergedResult<Sharding
return result;
}
- private boolean getValueCaseSensitiveFromTables(final ExecuteQueryResult queryResult,
+ private boolean getValueCaseSensitiveFromTables(final QueryResult queryResult,
final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema, final int columnIndex) throws SQLException {
for (SimpleTableSegment each : selectStatementContext.getSimpleTableSegments()) {
String tableName = each.getTableName().getIdentifier().getValue();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResult.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResult.java
index dc0c0d8..51425fb 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResult.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResult.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.AggregationDistinctProjection;
import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.AggregationProjection;
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import java.sql.SQLException;
import java.util.ArrayList;
@@ -47,7 +47,7 @@ public final class GroupByStreamMergedResult extends OrderByStreamMergedResult {
private List<?> currentGroupByValues;
- public GroupByStreamMergedResult(final Map<String, Integer> labelAndIndexMap, final List<ExecuteQueryResult> queryResults,
+ public GroupByStreamMergedResult(final Map<String, Integer> labelAndIndexMap, final List<QueryResult> queryResults,
final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
super(queryResults, selectStatementContext, schema);
this.selectStatementContext = selectStatementContext;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValue.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValue.java
index 70ee2d1..721aba5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValue.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValue.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.merge.dql.groupby;
import lombok.EqualsAndHashCode;
import lombok.Getter;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByItem;
import java.sql.SQLException;
@@ -36,11 +36,11 @@ public final class GroupByValue {
private final List<?> groupValues;
- public GroupByValue(final ExecuteQueryResult queryResult, final Collection<OrderByItem> groupByItems) throws SQLException {
+ public GroupByValue(final QueryResult queryResult, final Collection<OrderByItem> groupByItems) throws SQLException {
groupValues = getGroupByValues(queryResult, groupByItems);
}
- private List<?> getGroupByValues(final ExecuteQueryResult queryResult, final Collection<OrderByItem> groupByItems) throws SQLException {
+ private List<?> getGroupByValues(final QueryResult queryResult, final Collection<OrderByItem> groupByItems) throws SQLException {
List<Object> result = new ArrayList<>(groupByItems.size());
for (OrderByItem each : groupByItems) {
result.add(queryResult.getValue(each.getIndex(), Object.class));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResult.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResult.java
index 23a5f20..5207717 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResult.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResult.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.merge.dql.iterator;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.stream.StreamMergedResult;
import java.sql.SQLException;
@@ -29,9 +29,9 @@ import java.util.List;
*/
public final class IteratorStreamMergedResult extends StreamMergedResult {
- private final Iterator<ExecuteQueryResult> queryResults;
+ private final Iterator<QueryResult> queryResults;
- public IteratorStreamMergedResult(final List<ExecuteQueryResult> queryResults) {
+ public IteratorStreamMergedResult(final List<QueryResult> queryResults) {
this.queryResults = queryResults.iterator();
setCurrentQueryResult(this.queryResults.next());
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResult.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResult.java
index 264dd91..16b66e9 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResult.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResult.java
@@ -21,7 +21,7 @@ import lombok.AccessLevel;
import lombok.Getter;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.stream.StreamMergedResult;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByItem;
@@ -44,15 +44,15 @@ public class OrderByStreamMergedResult extends StreamMergedResult {
@Getter(AccessLevel.PROTECTED)
private boolean isFirstNext;
- public OrderByStreamMergedResult(final List<ExecuteQueryResult> queryResults, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
+ public OrderByStreamMergedResult(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
orderByItems = selectStatementContext.getOrderByContext().getItems();
orderByValuesQueue = new PriorityQueue<>(queryResults.size());
orderResultSetsToQueue(queryResults, selectStatementContext, schema);
isFirstNext = true;
}
- private void orderResultSetsToQueue(final List<ExecuteQueryResult> queryResults, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
- for (ExecuteQueryResult each : queryResults) {
+ private void orderResultSetsToQueue(final List<QueryResult> queryResults, final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
+ for (QueryResult each : queryResults) {
OrderByValue orderByValue = new OrderByValue(each, orderByItems, selectStatementContext, schema);
if (orderByValue.next()) {
orderByValuesQueue.offer(orderByValue);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java
index 1cda71f..a18e564 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValue.java
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.Co
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.OrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import java.sql.SQLException;
import java.util.ArrayList;
@@ -43,7 +43,7 @@ import java.util.Map;
public final class OrderByValue implements Comparable<OrderByValue> {
@Getter
- private final ExecuteQueryResult queryResult;
+ private final QueryResult queryResult;
private final Collection<OrderByItem> orderByItems;
@@ -51,7 +51,7 @@ public final class OrderByValue implements Comparable<OrderByValue> {
private List<Comparable<?>> orderValues;
- public OrderByValue(final ExecuteQueryResult queryResult, final Collection<OrderByItem> orderByItems,
+ public OrderByValue(final QueryResult queryResult, final Collection<OrderByItem> orderByItems,
final SelectStatementContext selectStatementContext, final ShardingSphereSchema schema) throws SQLException {
this.queryResult = queryResult;
this.orderByItems = orderByItems;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java
index 2234fb0..3cd3f34 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/ShardingDALResultMergerTest.java
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQ
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowDatabasesStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowOtherStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowTablesStatement;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
import org.junit.Before;
import org.junit.Test;
@@ -44,11 +44,11 @@ import static org.mockito.Mockito.when;
public final class ShardingDALResultMergerTest {
- private final List<ExecuteQueryResult> queryResults = new LinkedList<>();
+ private final List<QueryResult> queryResults = new LinkedList<>();
@Before
public void setUp() {
- queryResults.add(mock(ExecuteQueryResult.class));
+ queryResults.add(mock(QueryResult.class));
}
@Test
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResultTest.java
index ac945d1..d562640 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowCreateTableMergedResultTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.merge.dal.show;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.metadata.schema.model.TableMetaData;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
@@ -75,8 +75,8 @@ public final class ShowCreateTableMergedResultTest {
assertTrue(new ShowCreateTableMergedResult(shardingRule, mock(SQLStatementContext.class), schema, Collections.singletonList(mockQueryResult())).next());
}
- private ExecuteQueryResult mockQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult mockQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.getColumnCount()).thenReturn(2);
when(result.next()).thenReturn(true, false);
when(result.getValue(1, Object.class)).thenReturn("table_0");
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowTablesMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowTablesMergedResultTest.java
index e5e3063..2aa1787 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowTablesMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dal/show/ShowTablesMergedResultTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.merge.dal.show;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.metadata.schema.model.TableMetaData;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
@@ -65,8 +65,8 @@ public final class ShowTablesMergedResultTest {
return new ShardingSphereSchema(tableMetaDataMap);
}
- private ExecuteQueryResult mockQueryResult(final String value) throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult mockQueryResult(final String value) throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.next()).thenReturn(true, false);
when(result.getValue(1, Object.class)).thenReturn(value);
when(result.getColumnCount()).thenReturn(1);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
index 0eb6eac..3fad0da 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.merge.dql;
import com.google.common.collect.ImmutableMap;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByMemoryMergedResult;
import org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByStreamMergedResult;
@@ -317,18 +317,18 @@ public final class ShardingDQLResultMergerTest {
assertThat(((TopAndRowNumberDecoratorMergedResult) actual).getMergedResult(), instanceOf(GroupByMemoryMergedResult.class));
}
- private List<ExecuteQueryResult> createQueryResults() throws SQLException {
- List<ExecuteQueryResult> result = new LinkedList<>();
- ExecuteQueryResult queryResult = createQueryResult();
+ private List<QueryResult> createQueryResults() throws SQLException {
+ List<QueryResult> result = new LinkedList<>();
+ QueryResult queryResult = createQueryResult();
result.add(queryResult);
- result.add(mock(ExecuteQueryResult.class));
- result.add(mock(ExecuteQueryResult.class));
- result.add(mock(ExecuteQueryResult.class));
+ result.add(mock(QueryResult.class));
+ result.add(mock(QueryResult.class));
+ result.add(mock(QueryResult.class));
return result;
}
- private ExecuteQueryResult createQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult createQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.getColumnCount()).thenReturn(1);
when(result.getColumnLabel(1)).thenReturn("count(*)");
when(result.getValue(1, Object.class)).thenReturn(0);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
index 94fa263..5dac083 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql.groupby;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
@@ -63,15 +63,15 @@ public final class GroupByMemoryMergedResultTest {
@Test
public void assertNextForSomeResultSetsEmpty() throws SQLException {
- ExecuteQueryResult queryResult1 = createQueryResult();
+ QueryResult queryResult1 = createQueryResult();
when(queryResult1.next()).thenReturn(true, false);
when(queryResult1.getValue(1, Object.class)).thenReturn(20);
when(queryResult1.getValue(2, Object.class)).thenReturn(0);
when(queryResult1.getValue(3, Object.class)).thenReturn(2);
when(queryResult1.getValue(4, Object.class)).thenReturn(2);
when(queryResult1.getValue(5, Object.class)).thenReturn(20);
- ExecuteQueryResult queryResult2 = createQueryResult();
- ExecuteQueryResult queryResult3 = createQueryResult();
+ QueryResult queryResult2 = createQueryResult();
+ QueryResult queryResult3 = createQueryResult();
when(queryResult3.next()).thenReturn(true, true, false);
when(queryResult3.getValue(1, Object.class)).thenReturn(20, 30);
when(queryResult3.getValue(2, Object.class)).thenReturn(0);
@@ -118,15 +118,15 @@ public final class GroupByMemoryMergedResultTest {
@Test
public void assertNextForAggregationResultSetsEmpty() throws SQLException {
- ExecuteQueryResult queryResult1 = createQueryResult();
+ QueryResult queryResult1 = createQueryResult();
when(queryResult1.next()).thenReturn(true, false);
when(queryResult1.getValue(1, Object.class)).thenReturn(20);
when(queryResult1.getValue(2, Object.class)).thenReturn(0);
when(queryResult1.getValue(3, Object.class)).thenReturn(2);
when(queryResult1.getValue(4, Object.class)).thenReturn(2);
when(queryResult1.getValue(5, Object.class)).thenReturn(20);
- ExecuteQueryResult queryResult2 = createQueryResult();
- ExecuteQueryResult queryResult3 = createQueryResult();
+ QueryResult queryResult2 = createQueryResult();
+ QueryResult queryResult3 = createQueryResult();
when(queryResult3.next()).thenReturn(true, true, false);
when(queryResult3.getValue(1, Object.class)).thenReturn(20, 30);
when(queryResult3.getValue(2, Object.class)).thenReturn(0);
@@ -156,8 +156,8 @@ public final class GroupByMemoryMergedResultTest {
return result;
}
- private ExecuteQueryResult createQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult createQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.getColumnCount()).thenReturn(5);
when(result.getColumnLabel(1)).thenReturn("COUNT(*)");
when(result.getColumnLabel(2)).thenReturn("AVG(num)");
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
index 15f8e83..35a3d34 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql.groupby;
import com.google.common.collect.Lists;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryQueryResultRow;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByContext;
@@ -290,12 +290,12 @@ public final class GroupByRowComparatorTest {
return result;
}
- private ExecuteQueryResult mockQueryResult(final Object... values) throws SQLException {
+ private QueryResult mockQueryResult(final Object... values) throws SQLException {
ResultSet resultSet = mock(ResultSet.class);
ResultSetMetaData resultSetMetaData = mock(ResultSetMetaData.class);
when(resultSet.getMetaData()).thenReturn(resultSetMetaData);
when(resultSetMetaData.getColumnCount()).thenReturn(values.length);
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ QueryResult result = mock(QueryResult.class);
when(result.getColumnCount()).thenReturn(values.length);
int index = 0;
for (Object each : values) {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
index 3e60f7e..b886eab 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.merge.dql.groupby;
import com.google.common.collect.ImmutableMap;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
import org.apache.shardingsphere.infra.metadata.schema.model.ColumnMetaData;
@@ -66,7 +66,7 @@ public final class GroupByStreamMergedResultTest {
@Test
public void assertNextForSomeResultSetsEmpty() throws SQLException {
- ExecuteQueryResult queryResult1 = mockQueryResult();
+ QueryResult queryResult1 = mockQueryResult();
when(queryResult1.next()).thenReturn(true, false);
when(queryResult1.getValue(1, Object.class)).thenReturn(20);
when(queryResult1.getValue(2, Object.class)).thenReturn(0);
@@ -74,8 +74,8 @@ public final class GroupByStreamMergedResultTest {
when(queryResult1.getValue(4, Object.class)).thenReturn(new Date(0L));
when(queryResult1.getValue(5, Object.class)).thenReturn(2);
when(queryResult1.getValue(6, Object.class)).thenReturn(20);
- ExecuteQueryResult queryResult2 = mockQueryResult();
- ExecuteQueryResult queryResult3 = mockQueryResult();
+ QueryResult queryResult2 = mockQueryResult();
+ QueryResult queryResult3 = mockQueryResult();
when(queryResult3.next()).thenReturn(true, true, false);
when(queryResult3.getValue(1, Object.class)).thenReturn(20, 30);
when(queryResult3.getValue(2, Object.class)).thenReturn(0);
@@ -104,21 +104,21 @@ public final class GroupByStreamMergedResultTest {
@Test
public void assertNextForMix() throws SQLException {
- ExecuteQueryResult queryResult1 = mockQueryResult();
+ QueryResult queryResult1 = mockQueryResult();
when(queryResult1.next()).thenReturn(true, false);
when(queryResult1.getValue(1, Object.class)).thenReturn(20);
when(queryResult1.getValue(2, Object.class)).thenReturn(0);
when(queryResult1.getValue(3, Object.class)).thenReturn(2);
when(queryResult1.getValue(5, Object.class)).thenReturn(2);
when(queryResult1.getValue(6, Object.class)).thenReturn(20);
- ExecuteQueryResult queryResult2 = mockQueryResult();
+ QueryResult queryResult2 = mockQueryResult();
when(queryResult2.next()).thenReturn(true, true, true, false);
when(queryResult2.getValue(1, Object.class)).thenReturn(20, 30, 30, 40);
when(queryResult2.getValue(2, Object.class)).thenReturn(0);
when(queryResult2.getValue(3, Object.class)).thenReturn(2, 2, 3, 3, 3, 4);
when(queryResult2.getValue(5, Object.class)).thenReturn(2, 2, 3, 3, 3, 4);
when(queryResult2.getValue(6, Object.class)).thenReturn(20, 20, 30, 30, 30, 40);
- ExecuteQueryResult queryResult3 = mockQueryResult();
+ QueryResult queryResult3 = mockQueryResult();
when(queryResult3.next()).thenReturn(true, true, false);
when(queryResult3.getValue(1, Object.class)).thenReturn(10, 30);
when(queryResult3.getValue(2, Object.class)).thenReturn(10);
@@ -185,8 +185,8 @@ public final class GroupByStreamMergedResultTest {
return new ShardingSphereSchema(ImmutableMap.of("tbl", tableMetaData));
}
- private ExecuteQueryResult mockQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult mockQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.getColumnCount()).thenReturn(6);
when(result.getColumnLabel(1)).thenReturn("COUNT(*)");
when(result.getColumnLabel(2)).thenReturn("AVG(num)");
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java
index be46fbd..c2fa849 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByValueTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.merge.dql.groupby;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByItem;
import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
@@ -40,7 +40,7 @@ import static org.mockito.Mockito.when;
public final class GroupByValueTest {
@Mock
- private ExecuteQueryResult queryResult;
+ private QueryResult queryResult;
@Before
public void setUp() throws SQLException {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java
index e600cb3..66e2650 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.Projecti
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dml.MySQLSelectStatement;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.junit.Before;
import org.junit.Test;
@@ -53,7 +53,7 @@ public final class IteratorStreamMergedResultTest {
@Test
public void assertNextForResultSetsAllEmpty() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
assertFalse(actual.next());
@@ -61,8 +61,8 @@ public final class IteratorStreamMergedResultTest {
@Test
public void assertNextForResultSetsAllNotEmpty() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
- for (ExecuteQueryResult each : queryResults) {
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
+ for (QueryResult each : queryResults) {
when(each.next()).thenReturn(true, false);
}
ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
@@ -75,7 +75,7 @@ public final class IteratorStreamMergedResultTest {
@Test
public void assertNextForFirstResultSetsNotEmptyOnly() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
when(queryResults.get(0).next()).thenReturn(true, false);
ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
@@ -85,7 +85,7 @@ public final class IteratorStreamMergedResultTest {
@Test
public void assertNextForMiddleResultSetsNotEmpty() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
when(queryResults.get(1).next()).thenReturn(true, false);
ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
@@ -95,7 +95,7 @@ public final class IteratorStreamMergedResultTest {
@Test
public void assertNextForLastResultSetsNotEmptyOnly() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
when(queryResults.get(2).next()).thenReturn(true, false);
ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
@@ -105,8 +105,8 @@ public final class IteratorStreamMergedResultTest {
@Test
public void assertNextForMix() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class),
- mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class),
+ mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
when(queryResults.get(1).next()).thenReturn(true, false);
when(queryResults.get(3).next()).thenReturn(true, false);
when(queryResults.get(5).next()).thenReturn(true, false);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
index 45a95a4..9fdb960 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.sharding.merge.dql.orderby;
import com.google.common.collect.ImmutableMap;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
import org.apache.shardingsphere.infra.metadata.schema.model.ColumnMetaData;
@@ -72,7 +72,7 @@ public final class OrderByStreamMergedResultTest {
@Test
public void assertNextForResultSetsAllEmpty() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, buildSchema());
assertFalse(actual.next());
@@ -80,7 +80,7 @@ public final class OrderByStreamMergedResultTest {
@Test
public void assertNextForSomeResultSetsEmpty() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
for (int i = 0; i < 3; i++) {
when(queryResults.get(i).getColumnName(1)).thenReturn("col1");
when(queryResults.get(i).getColumnName(2)).thenReturn("col2");
@@ -102,7 +102,7 @@ public final class OrderByStreamMergedResultTest {
@Test
public void assertNextForMix() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
for (int i = 0; i < 3; i++) {
when(queryResults.get(i).getColumnName(1)).thenReturn("col1");
when(queryResults.get(i).getColumnName(2)).thenReturn("col2");
@@ -132,7 +132,7 @@ public final class OrderByStreamMergedResultTest {
@Test
public void assertNextForCaseSensitive() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
for (int i = 0; i < 3; i++) {
when(queryResults.get(i).getColumnName(1)).thenReturn("col1");
when(queryResults.get(i).getColumnName(2)).thenReturn("col2");
@@ -158,7 +158,7 @@ public final class OrderByStreamMergedResultTest {
@Test
public void assertNextForCaseInsensitive() throws SQLException {
- List<ExecuteQueryResult> queryResults = Arrays.asList(mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class), mock(ExecuteQueryResult.class));
+ List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
for (int i = 0; i < 3; i++) {
when(queryResults.get(i).getColumnName(1)).thenReturn("col1");
when(queryResults.get(i).getColumnName(2)).thenReturn("col2");
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
index 6fcdd3d..2ae7963 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql.orderby;
import com.google.common.collect.Lists;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
import org.apache.shardingsphere.infra.binder.segment.select.orderby.OrderByContext;
@@ -87,14 +87,14 @@ public final class OrderByValueTest {
SelectStatementContext selectStatementContext = new SelectStatementContext(
selectStatement, new GroupByContext(Collections.emptyList(), 0), createOrderBy(), createProjectionsContext(), null);
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
- ExecuteQueryResult queryResult1 = createQueryResult("1", "2");
+ QueryResult queryResult1 = createQueryResult("1", "2");
OrderByValue orderByValue1 = new OrderByValue(queryResult1, Arrays.asList(
createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, OrderDirection.ASC)),
createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, OrderDirection.ASC))),
selectStatementContext, schema);
FieldSetter.setField(orderByValue1, OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), Arrays.asList(false, false));
assertTrue(orderByValue1.next());
- ExecuteQueryResult queryResult2 = createQueryResult("3", "4");
+ QueryResult queryResult2 = createQueryResult("3", "4");
OrderByValue orderByValue2 = new OrderByValue(queryResult2, Arrays.asList(
createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, OrderDirection.ASC)),
createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.ASC, OrderDirection.ASC))),
@@ -137,14 +137,14 @@ public final class OrderByValueTest {
SelectStatementContext selectStatementContext = new SelectStatementContext(
selectStatement, new GroupByContext(Collections.emptyList(), 0), createOrderBy(), createProjectionsContext(), null);
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
- ExecuteQueryResult queryResult1 = createQueryResult("1", "2");
+ QueryResult queryResult1 = createQueryResult("1", "2");
OrderByValue orderByValue1 = new OrderByValue(queryResult1, Arrays.asList(
createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC)),
createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, OrderDirection.ASC))),
selectStatementContext, schema);
FieldSetter.setField(orderByValue1, OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), Arrays.asList(false, false));
assertTrue(orderByValue1.next());
- ExecuteQueryResult queryResult2 = createQueryResult("3", "4");
+ QueryResult queryResult2 = createQueryResult("3", "4");
OrderByValue orderByValue2 = new OrderByValue(queryResult2, Arrays.asList(
createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC)),
createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, OrderDirection.ASC))),
@@ -187,14 +187,14 @@ public final class OrderByValueTest {
SelectStatementContext selectStatementContext = new SelectStatementContext(
selectStatement, new GroupByContext(Collections.emptyList(), 0), createOrderBy(), createProjectionsContext(), null);
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
- ExecuteQueryResult queryResult1 = createQueryResult("1", "2");
+ QueryResult queryResult1 = createQueryResult("1", "2");
OrderByValue orderByValue1 = new OrderByValue(queryResult1, Arrays.asList(
createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, OrderDirection.ASC)),
createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, OrderDirection.ASC))),
selectStatementContext, schema);
FieldSetter.setField(orderByValue1, OrderByValue.class.getDeclaredField("orderValuesCaseSensitive"), Arrays.asList(false, false));
assertTrue(orderByValue1.next());
- ExecuteQueryResult queryResult2 = createQueryResult("1", "2");
+ QueryResult queryResult2 = createQueryResult("1", "2");
OrderByValue orderByValue2 = new OrderByValue(queryResult2, Arrays.asList(
createOrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.ASC, OrderDirection.ASC)),
createOrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, OrderDirection.ASC))),
@@ -206,8 +206,8 @@ public final class OrderByValueTest {
assertFalse(orderByValue2.getQueryResult().next());
}
- private ExecuteQueryResult createQueryResult(final String... values) throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult createQueryResult(final String... values) throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.next()).thenReturn(true, false);
for (int i = 0; i < values.length; i++) {
when(result.getValue(i + 1, Object.class)).thenReturn(values[i]);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java
index 354642f..e256191 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementConte
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.NumberLiteralLimitValueSegment;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dml.MySQLSelectStatement;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.junit.Test;
@@ -79,8 +79,8 @@ public final class LimitDecoratorMergedResultTest {
assertFalse(actual.next());
}
- private ExecuteQueryResult mockQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult mockQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.next()).thenReturn(true, true, false);
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java
index 4af643c..f104ebb 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql.pagination;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
@@ -92,8 +92,8 @@ public final class RowNumberDecoratorMergedResultTest {
assertFalse(actual.next());
}
- private ExecuteQueryResult mockQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult mockQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.next()).thenReturn(true, true, false);
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
index acdb0db..85d60b6 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql.pagination;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
import org.apache.shardingsphere.infra.binder.segment.select.groupby.GroupByContext;
@@ -108,8 +108,8 @@ public final class TopAndRowNumberDecoratorMergedResultTest {
assertFalse(actual.next());
}
- private ExecuteQueryResult mockQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult mockQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.next()).thenReturn(true, true, false);
return result;
}
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
index c87bb38..3aaeb08 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutor.java
@@ -23,8 +23,8 @@ import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutorExceptionHandler;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.callback.RawSQLExecutorCallback;
import org.apache.shardingsphere.infra.executor.sql.execute.result.ExecuteResult;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.update.ExecuteUpdateResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.update.UpdateResult;
import java.sql.SQLException;
import java.util.Collection;
@@ -50,8 +50,8 @@ public final class RawExecutor {
* @return Query results
* @throws SQLException SQL exception
*/
- public List<ExecuteQueryResult> executeQuery(final Collection<ExecutionGroup<RawSQLExecutionUnit>> executionGroups, final RawSQLExecutorCallback callback) throws SQLException {
- return doExecute(executionGroups, callback).stream().map(each -> (ExecuteQueryResult) each).collect(Collectors.toList());
+ public List<QueryResult> executeQuery(final Collection<ExecutionGroup<RawSQLExecutionUnit>> executionGroups, final RawSQLExecutorCallback callback) throws SQLException {
+ return doExecute(executionGroups, callback).stream().map(each -> (QueryResult) each).collect(Collectors.toList());
}
/**
@@ -63,7 +63,7 @@ public final class RawExecutor {
* @throws SQLException SQL exception
*/
public int executeUpdate(final Collection<ExecutionGroup<RawSQLExecutionUnit>> executionGroups, final RawSQLExecutorCallback callback) throws SQLException {
- List<Integer> results = doExecute(executionGroups, callback).stream().map(each -> ((ExecuteUpdateResult) each).getUpdateCount()).collect(Collectors.toList());
+ List<Integer> results = doExecute(executionGroups, callback).stream().map(each -> ((UpdateResult) each).getUpdateCount()).collect(Collectors.toList());
// TODO check is need to accumulate
// TODO refresh metadata
return accumulate(results);
@@ -91,7 +91,7 @@ public final class RawExecutor {
if (null == results || results.isEmpty() || null == results.get(0)) {
return false;
}
- return results.get(0) instanceof ExecuteQueryResult;
+ return results.get(0) instanceof QueryResult;
}
@SuppressWarnings("unchecked")
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/ExecuteQueryResult.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/QueryResult.java
similarity index 95%
rename from shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/ExecuteQueryResult.java
rename to shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/QueryResult.java
index 8a04745..1e84396 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/ExecuteQueryResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/QueryResult.java
@@ -24,9 +24,9 @@ import java.sql.SQLException;
import java.util.Calendar;
/**
- * Execute query result.
+ * Query result.
*/
-public interface ExecuteQueryResult extends ExecuteResult {
+public interface QueryResult extends ExecuteResult {
/**
* Iterate next data.
@@ -58,19 +58,19 @@ public interface ExecuteQueryResult extends ExecuteResult {
Object getCalendarValue(int columnIndex, Class<?> type, Calendar calendar) throws SQLException;
/**
- * Get InputStream.
+ * Get input stream.
*
* @param columnIndex column index
* @param type class type of data value
- * @return InputStream
+ * @return input stream
* @throws SQLException SQL Exception
*/
InputStream getInputStream(int columnIndex, String type) throws SQLException;
/**
- * Judge ResultSet is null or not.
+ * Judge result set is null or not.
*
- * @return ResultSet is null or not
+ * @return result set is null or not
* @throws SQLException SQL Exception
*/
boolean wasNull() throws SQLException;
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/jdbc/AbstractJDBCQueryResult.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/jdbc/AbstractJDBCQueryResult.java
index 5d69ef7..a0af69f 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/jdbc/AbstractJDBCQueryResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/jdbc/AbstractJDBCQueryResult.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
@@ -27,7 +27,7 @@ import java.sql.SQLException;
* Abstract JDBC query result.
*/
@RequiredArgsConstructor
-public abstract class AbstractJDBCQueryResult implements ExecuteQueryResult {
+public abstract class AbstractJDBCQueryResult implements QueryResult {
private final ResultSetMetaData resultSetMetaData;
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/raw/RawQueryResult.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/raw/RawQueryResult.java
index c8c436f..2c4fe74 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/raw/RawQueryResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/raw/RawQueryResult.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.executor.sql.execute.result.query.raw;
import lombok.SneakyThrows;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.raw.metadata.QueryResultMetaData;
import java.io.ByteArrayInputStream;
@@ -33,7 +33,7 @@ import java.util.List;
/**
* Raw query result.
*/
-public final class RawQueryResult implements ExecuteQueryResult {
+public final class RawQueryResult implements QueryResult {
private final QueryResultMetaData metaData;
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/update/ExecuteUpdateResult.java b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/update/UpdateResult.java
similarity index 92%
rename from shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/update/ExecuteUpdateResult.java
rename to shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/update/UpdateResult.java
index 9b77cb0..0dbf8a4 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/update/ExecuteUpdateResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/update/UpdateResult.java
@@ -22,11 +22,11 @@ import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.executor.sql.execute.result.ExecuteResult;
/**
- * Execute update result.
+ * Update result.
*/
@RequiredArgsConstructor
@Getter
-public final class ExecuteUpdateResult implements ExecuteResult {
+public final class UpdateResult implements ExecuteResult {
private final int updateCount;
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutorTest.java b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutorTest.java
index 8098882..0db9e8b 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutorTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/execute/engine/raw/RawExecutorTest.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.infra.executor.sql.execute.engine.raw;
import org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutorExceptionHandler;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.update.ExecuteUpdateResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.update.UpdateResult;
import org.junit.Test;
import java.sql.SQLException;
@@ -47,29 +47,29 @@ public final class RawExecutorTest {
}
@Test
- public void assertExecuteForExecuteQueryResult() throws SQLException {
+ public void assertExecuteForQueryResult() throws SQLException {
ExecutorEngine executorEngine = mock(ExecutorEngine.class);
- when(executorEngine.execute(any(), any(), any(), anyBoolean())).thenReturn(Collections.singletonList(mock(ExecuteQueryResult.class)));
+ when(executorEngine.execute(any(), any(), any(), anyBoolean())).thenReturn(Collections.singletonList(mock(QueryResult.class)));
RawExecutor executor = new RawExecutor(executorEngine, true);
assertTrue(executor.execute(null, null));
}
@Test
- public void assertExecuteQueryForExecuteQueryResult() throws SQLException {
+ public void assertExecuteQueryForQueryResult() throws SQLException {
ExecutorEngine executorEngine = mock(ExecutorEngine.class);
- ExecuteQueryResult executeQueryResult = mock(ExecuteQueryResult.class);
- when(executorEngine.execute(any(), any(), any(), anyBoolean())).thenReturn(Collections.singletonList(executeQueryResult));
+ QueryResult queryResult = mock(QueryResult.class);
+ when(executorEngine.execute(any(), any(), any(), anyBoolean())).thenReturn(Collections.singletonList(queryResult));
RawExecutor executor = new RawExecutor(executorEngine, true);
- List<ExecuteQueryResult> actual = executor.executeQuery(null, null);
- assertThat(actual, is(Collections.singletonList(executeQueryResult)));
+ List<QueryResult> actual = executor.executeQuery(null, null);
+ assertThat(actual, is(Collections.singletonList(queryResult)));
}
@Test
public void assertExecuteUpdate() throws SQLException {
ExecutorEngine executorEngine = mock(ExecutorEngine.class);
- ExecuteUpdateResult executeUpdateResult1 = new ExecuteUpdateResult(1, 2);
- ExecuteUpdateResult executeUpdateResult2 = new ExecuteUpdateResult(3, 4);
- when(executorEngine.execute(any(), any(), any(), anyBoolean())).thenReturn(Arrays.asList(executeUpdateResult1, executeUpdateResult2));
+ UpdateResult updateResult1 = new UpdateResult(1, 2);
+ UpdateResult updateResult2 = new UpdateResult(3, 4);
+ when(executorEngine.execute(any(), any(), any(), anyBoolean())).thenReturn(Arrays.asList(updateResult1, updateResult2));
RawExecutor executor = new RawExecutor(executorEngine, true);
assertThat(executor.executeUpdate(null, null), is(4));
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/MergeEngine.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/MergeEngine.java
index 2850d4d..d9b3338 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/MergeEngine.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/MergeEngine.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.merge;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.ResultProcessEngine;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecorator;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecoratorEngine;
@@ -73,14 +73,14 @@ public final class MergeEngine {
* @return merged result
* @throws SQLException SQL exception
*/
- public MergedResult merge(final List<ExecuteQueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext) throws SQLException {
+ public MergedResult merge(final List<QueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext) throws SQLException {
Optional<MergedResult> mergedResult = executeMerge(queryResults, sqlStatementContext);
Optional<MergedResult> result = mergedResult.isPresent() ? Optional.of(decorate(mergedResult.get(), sqlStatementContext)) : decorate(queryResults.get(0), sqlStatementContext);
return result.orElseGet(() -> new TransparentMergedResult(queryResults.get(0)));
}
@SuppressWarnings({"unchecked", "rawtypes"})
- private Optional<MergedResult> executeMerge(final List<ExecuteQueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext) throws SQLException {
+ private Optional<MergedResult> executeMerge(final List<QueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext) throws SQLException {
for (Entry<ShardingSphereRule, ResultProcessEngine> entry : engines.entrySet()) {
if (entry.getValue() instanceof ResultMergerEngine) {
ResultMerger resultMerger = ((ResultMergerEngine) entry.getValue()).newInstance(databaseType, entry.getKey(), props, sqlStatementContext);
@@ -103,7 +103,7 @@ public final class MergeEngine {
}
@SuppressWarnings({"unchecked", "rawtypes"})
- private Optional<MergedResult> decorate(final ExecuteQueryResult queryResult, final SQLStatementContext<?> sqlStatementContext) throws SQLException {
+ private Optional<MergedResult> decorate(final QueryResult queryResult, final SQLStatementContext<?> sqlStatementContext) throws SQLException {
MergedResult result = null;
for (Entry<ShardingSphereRule, ResultProcessEngine> entry : engines.entrySet()) {
if (entry.getValue() instanceof ResultDecoratorEngine) {
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/ResultDecorator.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/ResultDecorator.java
index 177f55c..aa271e1 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/ResultDecorator.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/ResultDecorator.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.merge.engine.decorator;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
@@ -40,7 +40,7 @@ public interface ResultDecorator<T extends ShardingSphereRule> {
* @return merged result
* @throws SQLException SQL exception
*/
- MergedResult decorate(ExecuteQueryResult queryResult, SQLStatementContext<?> sqlStatementContext, T rule) throws SQLException;
+ MergedResult decorate(QueryResult queryResult, SQLStatementContext<?> sqlStatementContext, T rule) throws SQLException;
/**
* Decorate merged result.
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecorator.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecorator.java
index f089e5f..81ab95d 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecorator.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecorator.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.merge.engine.decorator.impl;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecorator;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
@@ -29,7 +29,7 @@ import org.apache.shardingsphere.infra.merge.result.impl.transparent.Transparent
public final class TransparentResultDecorator implements ResultDecorator<TransparentRule> {
@Override
- public MergedResult decorate(final ExecuteQueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final TransparentRule rule) {
+ public MergedResult decorate(final QueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final TransparentRule rule) {
return new TransparentMergedResult(queryResult);
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/ResultMerger.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/ResultMerger.java
index 7efb48c..63263eb 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/ResultMerger.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/ResultMerger.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.merge.engine.merger;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import java.sql.SQLException;
@@ -39,5 +39,5 @@ public interface ResultMerger {
* @return merged result
* @throws SQLException SQL exception
*/
- MergedResult merge(List<ExecuteQueryResult> queryResults, SQLStatementContext<?> sqlStatementContext, ShardingSphereSchema schema) throws SQLException;
+ MergedResult merge(List<QueryResult> queryResults, SQLStatementContext<?> sqlStatementContext, ShardingSphereSchema schema) throws SQLException;
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMerger.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMerger.java
index ab28d0c..9343925 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMerger.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMerger.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.merge.engine.merger.impl;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.merger.ResultMerger;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.transparent.TransparentMergedResult;
@@ -32,7 +32,7 @@ import java.util.List;
public final class TransparentResultMerger implements ResultMerger {
@Override
- public MergedResult merge(final List<ExecuteQueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) {
+ public MergedResult merge(final List<QueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) {
return new TransparentMergedResult(queryResults.get(0));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryMergedResult.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryMergedResult.java
index bba5615..22a56e7 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryMergedResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryMergedResult.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.merge.result.impl.memory;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
@@ -47,7 +47,7 @@ public abstract class MemoryMergedResult<T extends ShardingSphereRule> implement
private boolean wasNull;
- protected MemoryMergedResult(final T rule, final ShardingSphereSchema schema, final SQLStatementContext sqlStatementContext, final List<ExecuteQueryResult> queryResults) throws SQLException {
+ protected MemoryMergedResult(final T rule, final ShardingSphereSchema schema, final SQLStatementContext sqlStatementContext, final List<QueryResult> queryResults) throws SQLException {
List<MemoryQueryResultRow> memoryQueryResultRowList = init(rule, schema, sqlStatementContext, queryResults);
memoryResultSetRows = memoryQueryResultRowList.iterator();
if (!memoryQueryResultRowList.isEmpty()) {
@@ -55,7 +55,7 @@ public abstract class MemoryMergedResult<T extends ShardingSphereRule> implement
}
}
- protected abstract List<MemoryQueryResultRow> init(T rule, ShardingSphereSchema schema, SQLStatementContext sqlStatementContext, List<ExecuteQueryResult> queryResults) throws SQLException;
+ protected abstract List<MemoryQueryResultRow> init(T rule, ShardingSphereSchema schema, SQLStatementContext sqlStatementContext, List<QueryResult> queryResults) throws SQLException;
@Override
public final boolean next() {
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRow.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRow.java
index 3ba8544..2dca509 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRow.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRow.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.merge.result.impl.memory;
import com.google.common.base.Preconditions;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import java.sql.SQLException;
@@ -31,11 +31,11 @@ public final class MemoryQueryResultRow {
private final Object[] data;
- public MemoryQueryResultRow(final ExecuteQueryResult queryResult) throws SQLException {
+ public MemoryQueryResultRow(final QueryResult queryResult) throws SQLException {
data = load(queryResult);
}
- private Object[] load(final ExecuteQueryResult queryResult) throws SQLException {
+ private Object[] load(final QueryResult queryResult) throws SQLException {
int columnCount = queryResult.getColumnCount();
Object[] result = new Object[columnCount];
for (int i = 0; i < columnCount; i++) {
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResult.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResult.java
index a2827a4..b92f992 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResult.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.merge.result.impl.stream;
import lombok.Setter;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import java.io.InputStream;
@@ -31,11 +31,11 @@ import java.util.Calendar;
@Setter
public abstract class StreamMergedResult implements MergedResult {
- private ExecuteQueryResult currentQueryResult;
+ private QueryResult currentQueryResult;
private boolean wasNull;
- protected final ExecuteQueryResult getCurrentQueryResult() throws SQLException {
+ protected final QueryResult getCurrentQueryResult() throws SQLException {
if (null == currentQueryResult) {
throw new SQLException("Current ResultSet is null, ResultSet perhaps end of next.");
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResult.java b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResult.java
index b0b23f2..b24eb53 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResult.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.merge.result.impl.transparent;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import java.io.InputStream;
@@ -31,7 +31,7 @@ import java.util.Calendar;
@RequiredArgsConstructor
public final class TransparentMergedResult implements MergedResult {
- private final ExecuteQueryResult queryResult;
+ private final QueryResult queryResult;
@Override
public boolean next() throws SQLException {
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/MergeEngineTest.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/MergeEngineTest.java
index 7aaf3a2..ddaf450 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/MergeEngineTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/MergeEngineTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.merge;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.fixture.rule.DecoratorRuleFixture;
import org.apache.shardingsphere.infra.merge.fixture.rule.IndependentRuleFixture;
import org.apache.shardingsphere.infra.merge.fixture.rule.MergerRuleFixture;
@@ -52,7 +52,7 @@ public final class MergeEngineTest {
private ConfigurationProperties props;
@Mock
- private ExecuteQueryResult queryResult;
+ private QueryResult queryResult;
@Mock
private SQLStatementContext<?> sqlStatementContext;
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecoratorTest.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecoratorTest.java
index 5c8961d..dda81e7 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecoratorTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/decorator/impl/TransparentResultDecoratorTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.merge.engine.decorator.impl;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.junit.Test;
@@ -32,7 +32,7 @@ public final class TransparentResultDecoratorTest {
@Test
public void assertDecorateQueryResult() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.next()).thenReturn(true);
TransparentResultDecorator decorator = new TransparentResultDecorator();
MergedResult actual = decorator.decorate(queryResult, mock(SQLStatementContext.class), new TransparentRule());
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMergerTest.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMergerTest.java
index e851012..04d78d2 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMergerTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/engine/merger/impl/TransparentResultMergerTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.merge.engine.merger.impl;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
@@ -34,7 +34,7 @@ public final class TransparentResultMergerTest {
@Test
public void assertMerge() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.next()).thenReturn(true);
TransparentResultMerger merger = new TransparentResultMerger();
MergedResult actual = merger.merge(Collections.singletonList(queryResult), mock(SQLStatementContext.class), mock(ShardingSphereSchema.class));
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/decorator/ResultDecoratorFixture.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/decorator/ResultDecoratorFixture.java
index 0e96285..239cf19 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/decorator/ResultDecoratorFixture.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/decorator/ResultDecoratorFixture.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.merge.fixture.decorator;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.StreamJDBCQueryResult;
import org.apache.shardingsphere.infra.merge.engine.decorator.ResultDecorator;
import org.apache.shardingsphere.infra.merge.fixture.rule.DecoratorRuleFixture;
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.when;
public final class ResultDecoratorFixture implements ResultDecorator<DecoratorRuleFixture> {
@Override
- public MergedResult decorate(final ExecuteQueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final DecoratorRuleFixture rule) throws SQLException {
+ public MergedResult decorate(final QueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final DecoratorRuleFixture rule) throws SQLException {
ResultSet resultSet = mock(ResultSet.class);
when(resultSet.getString(1)).thenReturn("decorated_value");
return new TransparentMergedResult(new StreamJDBCQueryResult(resultSet));
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/merger/ResultMergerFixture.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/merger/ResultMergerFixture.java
index 1323fe8..e39c472 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/merger/ResultMergerFixture.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/fixture/merger/ResultMergerFixture.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.merge.fixture.merger;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.StreamJDBCQueryResult;
import org.apache.shardingsphere.infra.merge.engine.merger.ResultMerger;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
@@ -35,10 +35,10 @@ import static org.mockito.Mockito.when;
public final class ResultMergerFixture implements ResultMerger {
@Override
- public MergedResult merge(final List<ExecuteQueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) throws SQLException {
+ public MergedResult merge(final List<QueryResult> queryResults, final SQLStatementContext<?> sqlStatementContext, final ShardingSphereSchema schema) throws SQLException {
ResultSet resultSet = mock(ResultSet.class);
when(resultSet.getString(1)).thenReturn("merged_value");
- ExecuteQueryResult queryResult = new StreamJDBCQueryResult(resultSet);
+ QueryResult queryResult = new StreamJDBCQueryResult(resultSet);
return new TransparentMergedResult(queryResult);
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRowTest.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRowTest.java
index 92b9dc2..52a80f87 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRowTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/MemoryQueryResultRowTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.merge.result.impl.memory;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.junit.Before;
import org.junit.Test;
@@ -34,7 +34,7 @@ public final class MemoryQueryResultRowTest {
@Before
public void setUp() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.getColumnCount()).thenReturn(1);
when(queryResult.getValue(1, Object.class)).thenReturn("value");
memoryResultSetRow = new MemoryQueryResultRow(queryResult);
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/fixture/TestMemoryMergedResult.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/fixture/TestMemoryMergedResult.java
index 84b5d28..cb7c64b 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/fixture/TestMemoryMergedResult.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/memory/fixture/TestMemoryMergedResult.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.merge.result.impl.memory.fixture;
import lombok.Getter;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.fixture.rule.IndependentRuleFixture;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryMergedResult;
import org.apache.shardingsphere.infra.merge.result.impl.memory.MemoryQueryResultRow;
@@ -42,7 +42,7 @@ public final class TestMemoryMergedResult extends MemoryMergedResult<Independent
@Override
protected List<MemoryQueryResultRow> init(final IndependentRuleFixture rule,
- final ShardingSphereSchema schema, final SQLStatementContext sqlStatementContext, final List<ExecuteQueryResult> queryResults) {
+ final ShardingSphereSchema schema, final SQLStatementContext sqlStatementContext, final List<QueryResult> queryResults) {
memoryQueryResultRow = mock(MemoryQueryResultRow.class);
return Collections.singletonList(memoryQueryResultRow);
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResultTest.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResultTest.java
index 919b954..25a9d03 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResultTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/stream/StreamMergedResultTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.merge.result.impl.stream;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.merge.result.impl.stream.fixture.TestStreamMergedResult;
import org.junit.Test;
@@ -43,7 +43,7 @@ public final class StreamMergedResultTest {
@Test
public void assertGetValue() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.getValue(1, Object.class)).thenReturn("1");
streamMergedResult.setCurrentQueryResult(queryResult);
assertThat(streamMergedResult.getValue(1, Object.class).toString(), is("1"));
@@ -51,7 +51,7 @@ public final class StreamMergedResultTest {
@Test
public void assertGetCalendarValue() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
Calendar calendar = Calendar.getInstance();
when(queryResult.getCalendarValue(1, Date.class, calendar)).thenReturn(new Date(0L));
streamMergedResult.setCurrentQueryResult(queryResult);
@@ -60,7 +60,7 @@ public final class StreamMergedResultTest {
@Test
public void assertGetInputStream() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
InputStream value = mock(InputStream.class);
when(queryResult.getInputStream(1, "Ascii")).thenReturn(value);
streamMergedResult.setCurrentQueryResult(queryResult);
@@ -69,7 +69,7 @@ public final class StreamMergedResultTest {
@Test
public void assertWasNull() {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
streamMergedResult.setCurrentQueryResult(queryResult);
assertFalse(streamMergedResult.wasNull());
}
diff --git a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResultTest.java b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResultTest.java
index 4337ef6..ddb46e9 100644
--- a/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResultTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-merge/src/test/java/org/apache/shardingsphere/infra/merge/result/impl/transparent/TransparentMergedResultTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.merge.result.impl.transparent;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
@@ -38,7 +38,7 @@ public final class TransparentMergedResultTest {
@Test
public void assertNext() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.next()).thenReturn(true, false);
TransparentMergedResult actual = new TransparentMergedResult(queryResult);
assertTrue(actual.next());
@@ -47,7 +47,7 @@ public final class TransparentMergedResultTest {
@Test
public void assertGetValue() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.getValue(1, Object.class)).thenReturn("1");
TransparentMergedResult actual = new TransparentMergedResult(queryResult);
assertThat(actual.getValue(1, Object.class).toString(), is("1"));
@@ -55,7 +55,7 @@ public final class TransparentMergedResultTest {
@Test
public void assertGetCalendarValue() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
when(queryResult.getCalendarValue(1, Date.class, null)).thenReturn(new Date(0L));
TransparentMergedResult actual = new TransparentMergedResult(queryResult);
assertThat(actual.getCalendarValue(1, Date.class, null), is(new Date(0L)));
@@ -63,7 +63,7 @@ public final class TransparentMergedResultTest {
@Test
public void assertGetInputStream() throws SQLException {
- ExecuteQueryResult queryResult = mock(ExecuteQueryResult.class);
+ QueryResult queryResult = mock(QueryResult.class);
InputStream value = mock(InputStream.class);
when(queryResult.getInputStream(1, "Ascii")).thenReturn(value);
TransparentMergedResult actual = new TransparentMergedResult(queryResult);
@@ -72,7 +72,7 @@ public final class TransparentMergedResultTest {
@Test
public void assertWasNull() throws SQLException {
- TransparentMergedResult actual = new TransparentMergedResult(mock(ExecuteQueryResult.class));
+ TransparentMergedResult actual = new TransparentMergedResult(mock(QueryResult.class));
assertFalse(actual.wasNull());
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/AbstractStatementExecutor.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/AbstractStatementExecutor.java
index f739112..1257be2 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/AbstractStatementExecutor.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/AbstractStatementExecutor.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.metadata.schema.builder.SchemaBuilderMaterials;
@@ -117,7 +117,7 @@ public abstract class AbstractStatementExecutor {
* @return query results
* @throws SQLException SQL exception
*/
- public abstract List<ExecuteQueryResult> executeQuery(Collection<ExecutionGroup<JDBCExecutionUnit>> executionGroups) throws SQLException;
+ public abstract List<QueryResult> executeQuery(Collection<ExecutionGroup<JDBCExecutionUnit>> executionGroups) throws SQLException;
/**
* Execute update.
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutor.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutor.java
index 66eba4e..d295b88 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutor.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutor.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutorEx
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.MemoryJDBCQueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.StreamJDBCQueryResult;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
@@ -52,21 +52,21 @@ public final class PreparedStatementExecutor extends AbstractStatementExecutor {
}
@Override
- public List<ExecuteQueryResult> executeQuery(final Collection<ExecutionGroup<JDBCExecutionUnit>> executionGroups) throws SQLException {
+ public List<QueryResult> executeQuery(final Collection<ExecutionGroup<JDBCExecutionUnit>> executionGroups) throws SQLException {
boolean isExceptionThrown = SQLExecutorExceptionHandler.isExceptionThrown();
- JDBCExecutorCallback<ExecuteQueryResult> callback = createJDBCExecutorCallbackWithQueryResult(isExceptionThrown);
+ JDBCExecutorCallback<QueryResult> callback = createJDBCExecutorCallbackWithQueryResult(isExceptionThrown);
return getJdbcExecutor().execute(executionGroups, callback);
}
- private JDBCExecutorCallback<ExecuteQueryResult> createJDBCExecutorCallbackWithQueryResult(final boolean isExceptionThrown) {
- return new JDBCExecutorCallback<ExecuteQueryResult>(getMetaDataContexts().getDatabaseType(), isExceptionThrown) {
+ private JDBCExecutorCallback<QueryResult> createJDBCExecutorCallbackWithQueryResult(final boolean isExceptionThrown) {
+ return new JDBCExecutorCallback<QueryResult>(getMetaDataContexts().getDatabaseType(), isExceptionThrown) {
@Override
- protected ExecuteQueryResult executeSQL(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
+ protected QueryResult executeSQL(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
return createQueryResult(statement, connectionMode);
}
- private ExecuteQueryResult createQueryResult(final Statement statement, final ConnectionMode connectionMode) throws SQLException {
+ private QueryResult createQueryResult(final Statement statement, final ConnectionMode connectionMode) throws SQLException {
PreparedStatement preparedStatement = (PreparedStatement) statement;
ResultSet resultSet = preparedStatement.executeQuery();
return ConnectionMode.MEMORY_STRICTLY == connectionMode ? new StreamJDBCQueryResult(resultSet) : new MemoryJDBCQueryResult(resultSet);
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/StatementExecutor.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/StatementExecutor.java
index 3874ff1..20b571a 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/StatementExecutor.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/executor/StatementExecutor.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutorEx
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutor;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.MemoryJDBCQueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.StreamJDBCQueryResult;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
@@ -51,16 +51,16 @@ public final class StatementExecutor extends AbstractStatementExecutor {
}
@Override
- public List<ExecuteQueryResult> executeQuery(final Collection<ExecutionGroup<JDBCExecutionUnit>> executionGroups) throws SQLException {
+ public List<QueryResult> executeQuery(final Collection<ExecutionGroup<JDBCExecutionUnit>> executionGroups) throws SQLException {
boolean isExceptionThrown = SQLExecutorExceptionHandler.isExceptionThrown();
- JDBCExecutorCallback<ExecuteQueryResult> jdbcExecutorCallback = new JDBCExecutorCallback<ExecuteQueryResult>(getMetaDataContexts().getDatabaseType(), isExceptionThrown) {
+ JDBCExecutorCallback<QueryResult> jdbcExecutorCallback = new JDBCExecutorCallback<QueryResult>(getMetaDataContexts().getDatabaseType(), isExceptionThrown) {
@Override
- protected ExecuteQueryResult executeSQL(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
+ protected QueryResult executeSQL(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
return createQueryResult(sql, statement, connectionMode);
}
- private ExecuteQueryResult createQueryResult(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
+ private QueryResult createQueryResult(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
ResultSet resultSet = statement.executeQuery(sql);
return ConnectionMode.MEMORY_STRICTLY == connectionMode ? new StreamJDBCQueryResult(resultSet) : new MemoryJDBCQueryResult(resultSet);
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
index ab64fd8..2d4b7c5 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
@@ -46,7 +46,7 @@ import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.J
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.RawExecutor;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.RawSQLExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.callback.RawSQLExecutorCallback;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.StreamJDBCQueryResult;
import org.apache.shardingsphere.infra.executor.sql.log.SQLLogger;
import org.apache.shardingsphere.infra.executor.sql.prepare.driver.DriverExecutionPrepareEngine;
@@ -157,7 +157,7 @@ public final class ShardingSpherePreparedStatement extends AbstractPreparedState
try {
clearPrevious();
executionContext = createExecutionContext();
- List<ExecuteQueryResult> queryResults;
+ List<QueryResult> queryResults;
if (metaDataContexts.getDefaultMetaData().getRuleMetaData().getRules().stream().anyMatch(each -> each instanceof RawExecutionRule)) {
queryResults = rawExecutor.executeQuery(createRawExecutionGroups(), new RawSQLExecutorCallback());
} else {
@@ -252,8 +252,8 @@ public final class ShardingSpherePreparedStatement extends AbstractPreparedState
return result;
}
- private List<ExecuteQueryResult> getQueryResults(final List<ResultSet> resultSets) throws SQLException {
- List<ExecuteQueryResult> result = new ArrayList<>(resultSets.size());
+ private List<QueryResult> getQueryResults(final List<ResultSet> resultSets) throws SQLException {
+ List<QueryResult> result = new ArrayList<>(resultSets.size());
for (ResultSet each : resultSets) {
if (null != each) {
result.add(new StreamJDBCQueryResult(each));
@@ -277,7 +277,7 @@ public final class ShardingSpherePreparedStatement extends AbstractPreparedState
return new LogicSQL(sqlStatementContext, sql, parameters);
}
- private MergedResult mergeQuery(final List<ExecuteQueryResult> queryResults) throws SQLException {
+ private MergedResult mergeQuery(final List<QueryResult> queryResults) throws SQLException {
ShardingSphereMetaData metaData = metaDataContexts.getDefaultMetaData();
MergeEngine mergeEngine = new MergeEngine(metaDataContexts.getDatabaseType(), metaData.getSchema(), metaDataContexts.getProps(), metaData.getRuleMetaData().getRules());
return mergeEngine.merge(queryResults, executionContext.getSqlStatementContext());
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
index efc7e2d..8876dc7 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
@@ -44,7 +44,7 @@ import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.J
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.RawExecutor;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.RawSQLExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.callback.RawSQLExecutorCallback;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.StreamJDBCQueryResult;
import org.apache.shardingsphere.infra.executor.sql.log.SQLLogger;
import org.apache.shardingsphere.infra.executor.sql.prepare.driver.DriverExecutionPrepareEngine;
@@ -126,7 +126,7 @@ public final class ShardingSphereStatement extends AbstractStatementAdapter {
ResultSet result;
try {
executionContext = createExecutionContext(sql);
- List<ExecuteQueryResult> queryResults;
+ List<QueryResult> queryResults;
if (metaDataContexts.getDefaultMetaData().getRuleMetaData().getRules().stream().anyMatch(each -> each instanceof RawExecutionRule)) {
queryResults = rawExecutor.executeQuery(createRawExecutionGroups(), new RawSQLExecutorCallback());
} else {
@@ -355,8 +355,8 @@ public final class ShardingSphereStatement extends AbstractStatementAdapter {
return result;
}
- private List<ExecuteQueryResult> getQueryResults(final List<ResultSet> resultSets) throws SQLException {
- List<ExecuteQueryResult> result = new ArrayList<>(resultSets.size());
+ private List<QueryResult> getQueryResults(final List<ResultSet> resultSets) throws SQLException {
+ List<QueryResult> result = new ArrayList<>(resultSets.size());
for (ResultSet each : resultSets) {
if (null != each) {
result.add(new StreamJDBCQueryResult(each));
@@ -365,7 +365,7 @@ public final class ShardingSphereStatement extends AbstractStatementAdapter {
return result;
}
- private MergedResult mergeQuery(final List<ExecuteQueryResult> queryResults) throws SQLException {
+ private MergedResult mergeQuery(final List<QueryResult> queryResults) throws SQLException {
ShardingSphereMetaData metaData = metaDataContexts.getDefaultMetaData();
MergeEngine mergeEngine = new MergeEngine(metaDataContexts.getDatabaseType(), metaData.getSchema(), metaDataContexts.getProps(), metaData.getRuleMetaData().getRules());
return mergeEngine.merge(queryResults, executionContext.getSqlStatementContext());
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutorTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutorTest.java
index 3cbc989..7e87716 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutorTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/PreparedStatementExecutorTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.driver.executor;
import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.context.SQLUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
@@ -105,7 +105,7 @@ public final class PreparedStatementExecutorTest extends AbstractBaseExecutorTes
when(resultSet2.getInt(1)).thenReturn(2);
when(preparedStatement1.executeQuery()).thenReturn(resultSet1);
when(preparedStatement2.executeQuery()).thenReturn(resultSet2);
- List<ExecuteQueryResult> result = actual.executeQuery(getExecutionGroups(Arrays.asList(preparedStatement1, preparedStatement2), true));
+ List<QueryResult> result = actual.executeQuery(getExecutionGroups(Arrays.asList(preparedStatement1, preparedStatement2), true));
assertThat(String.valueOf(result.get(0).getValue(1, int.class)), is("1"));
assertThat(String.valueOf(result.get(1).getValue(1, int.class)), is("2"));
verify(preparedStatement1).executeQuery();
@@ -117,7 +117,7 @@ public final class PreparedStatementExecutorTest extends AbstractBaseExecutorTes
PreparedStatement preparedStatement = getPreparedStatement();
SQLException ex = new SQLException("");
when(preparedStatement.executeQuery()).thenThrow(ex);
- assertThat(actual.executeQuery(getExecutionGroups(Collections.singletonList(preparedStatement), true)), is(Collections.singletonList((ExecuteQueryResult) null)));
+ assertThat(actual.executeQuery(getExecutionGroups(Collections.singletonList(preparedStatement), true)), is(Collections.singletonList((QueryResult) null)));
verify(preparedStatement).executeQuery();
}
@@ -128,8 +128,8 @@ public final class PreparedStatementExecutorTest extends AbstractBaseExecutorTes
SQLException ex = new SQLException("");
when(preparedStatement1.executeQuery()).thenThrow(ex);
when(preparedStatement2.executeQuery()).thenThrow(ex);
- List<ExecuteQueryResult> actualQueryResults = actual.executeQuery(getExecutionGroups(Arrays.asList(preparedStatement1, preparedStatement2), true));
- assertThat(actualQueryResults, is(Arrays.asList((ExecuteQueryResult) null, null)));
+ List<QueryResult> actualQueryResults = actual.executeQuery(getExecutionGroups(Arrays.asList(preparedStatement1, preparedStatement2), true));
+ assertThat(actualQueryResults, is(Arrays.asList((QueryResult) null, null)));
verify(preparedStatement1).executeQuery();
verify(preparedStatement2).executeQuery();
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/StatementExecutorTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/StatementExecutorTest.java
index 8b43027..d20f55b 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/StatementExecutorTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/StatementExecutorTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.driver.executor;
import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection;
import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.context.SQLUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
@@ -108,7 +108,7 @@ public final class StatementExecutorTest extends AbstractBaseExecutorTest {
when(resultSet2.getInt(1)).thenReturn(2);
when(statement1.executeQuery(DQL_SQL)).thenReturn(resultSet1);
when(statement2.executeQuery(DQL_SQL)).thenReturn(resultSet2);
- List<ExecuteQueryResult> result = actual.executeQuery(createExecutionGroups(Arrays.asList(statement1, statement2), true));
+ List<QueryResult> result = actual.executeQuery(createExecutionGroups(Arrays.asList(statement1, statement2), true));
assertThat(String.valueOf(result.get(0).getValue(1, int.class)), is("1"));
assertThat(String.valueOf(result.get(1).getValue(1, int.class)), is("2"));
verify(statement1).executeQuery(DQL_SQL);
@@ -120,7 +120,7 @@ public final class StatementExecutorTest extends AbstractBaseExecutorTest {
Statement statement = getStatement();
SQLException ex = new SQLException("");
when(statement.executeQuery(DQL_SQL)).thenThrow(ex);
- assertThat(actual.executeQuery(createExecutionGroups(Collections.singletonList(statement), true)), is(Collections.singletonList((ExecuteQueryResult) null)));
+ assertThat(actual.executeQuery(createExecutionGroups(Collections.singletonList(statement), true)), is(Collections.singletonList((QueryResult) null)));
verify(statement).executeQuery(DQL_SQL);
}
@@ -131,8 +131,8 @@ public final class StatementExecutorTest extends AbstractBaseExecutorTest {
SQLException ex = new SQLException("");
when(statement1.executeQuery(DQL_SQL)).thenThrow(ex);
when(statement2.executeQuery(DQL_SQL)).thenThrow(ex);
- List<ExecuteQueryResult> actualQueryResults = actual.executeQuery(createExecutionGroups(Arrays.asList(statement1, statement2), true));
- assertThat(actualQueryResults, is(Arrays.asList((ExecuteQueryResult) null, null)));
+ List<QueryResult> actualQueryResults = actual.executeQuery(createExecutionGroups(Arrays.asList(statement1, statement2), true));
+ assertThat(actualQueryResults, is(Arrays.asList((QueryResult) null, null)));
verify(statement1).executeQuery(DQL_SQL);
verify(statement2).executeQuery(DQL_SQL);
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
index 8c6c789..f8df4cc 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/JDBCDatabaseCommunicationEngine.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.binder.LogicSQL;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.context.kernel.KernelProcessor;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionContext;
import org.apache.shardingsphere.infra.executor.sql.log.SQLLogger;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryHeader;
@@ -135,7 +135,7 @@ public final class JDBCDatabaseCommunicationEngine implements DatabaseCommunicat
return dataNodeContainedRule.isPresent() && dataNodeContainedRule.get().isNeedAccumulate(sqlStatementContext.getTablesContext().getTableNames());
}
- private MergedResult mergeQuery(final SQLStatementContext<?> sqlStatementContext, final List<ExecuteQueryResult> queryResults) throws SQLException {
+ private MergedResult mergeQuery(final SQLStatementContext<?> sqlStatementContext, final List<QueryResult> queryResults) throws SQLException {
MergeEngine mergeEngine = new MergeEngine(ProxyContext.getInstance().getMetaDataContexts().getDatabaseType(),
metaData.getSchema(), ProxyContext.getInstance().getMetaDataContexts().getProps(), metaData.getRuleMetaData().getRules());
return mergeEngine.merge(queryResults, sqlStatementContext);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/JDBCExecuteEngine.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/JDBCExecuteEngine.java
index 42804b5..5bbf71a 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/JDBCExecuteEngine.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/JDBCExecuteEngine.java
@@ -32,7 +32,7 @@ import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.RawSQLExe
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.callback.RawSQLExecutorCallback;
import org.apache.shardingsphere.infra.executor.sql.execute.result.ExecuteResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryHeader;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.prepare.driver.DriverExecutionPrepareEngine;
import org.apache.shardingsphere.infra.executor.sql.prepare.driver.jdbc.StatementOption;
import org.apache.shardingsphere.infra.executor.sql.prepare.raw.RawExecutionPrepareEngine;
@@ -108,16 +108,16 @@ public final class JDBCExecuteEngine implements SQLExecuteEngine {
Collection<ExecuteResult> executeResults = execute(executionContext,
executionContext.getSqlStatementContext().getSqlStatement() instanceof InsertStatement, SQLExecutorExceptionHandler.isExceptionThrown());
ExecuteResult executeResult = executeResults.iterator().next();
- if (executeResult instanceof ExecuteQueryResult) {
+ if (executeResult instanceof QueryResult) {
ShardingSphereMetaData metaData = ProxyContext.getInstance().getMetaData(backendConnection.getSchemaName());
- int columnCount = ((ExecuteQueryResult) executeResult).getColumnCount();
+ int columnCount = ((QueryResult) executeResult).getColumnCount();
List<QueryHeader> queryHeaders = new ArrayList<>(columnCount);
for (int columnIndex = 1; columnIndex <= columnCount; columnIndex++) {
if (hasSelectExpandProjections(executionContext.getSqlStatementContext())) {
queryHeaders.add(QueryHeaderBuilder.build(
- ((SelectStatementContext) executionContext.getSqlStatementContext()).getProjectionsContext(), (ExecuteQueryResult) executeResult, metaData, columnIndex));
+ ((SelectStatementContext) executionContext.getSqlStatementContext()).getProjectionsContext(), (QueryResult) executeResult, metaData, columnIndex));
} else {
- queryHeaders.add(QueryHeaderBuilder.build((ExecuteQueryResult) executeResult, metaData, columnIndex));
+ queryHeaders.add(QueryHeaderBuilder.build((QueryResult) executeResult, metaData, columnIndex));
}
}
return getExecuteQueryResponse(queryHeaders, executeResults);
@@ -169,7 +169,7 @@ public final class JDBCExecuteEngine implements SQLExecuteEngine {
private BackendResponse getExecuteQueryResponse(final List<QueryHeader> queryHeaders, final Collection<ExecuteResult> executeResults) {
QueryResponse result = new QueryResponse(queryHeaders);
for (ExecuteResult each : executeResults) {
- result.getQueryResults().add((ExecuteQueryResult) each);
+ result.getQueryResults().add((QueryResult) each);
}
return result;
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/ProxyJDBCExecutorCallback.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/ProxyJDBCExecutorCallback.java
index b506251..d8f42ee 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/ProxyJDBCExecutorCallback.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/ProxyJDBCExecutorCallback.java
@@ -21,10 +21,10 @@ import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.ConnectionMode;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback;
import org.apache.shardingsphere.infra.executor.sql.execute.result.ExecuteResult;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.MemoryJDBCQueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.jdbc.StreamJDBCQueryResult;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.update.ExecuteUpdateResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.update.UpdateResult;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.statement.accessor.JDBCAccessor;
@@ -72,10 +72,10 @@ public final class ProxyJDBCExecutorCallback extends JDBCExecutorCallback<Execut
backendConnection.add(resultSet);
return createQueryResult(resultSet, connectionMode);
}
- return new ExecuteUpdateResult(statement.getUpdateCount(), isReturnGeneratedKeys ? getGeneratedKey(statement) : 0L);
+ return new UpdateResult(statement.getUpdateCount(), isReturnGeneratedKeys ? getGeneratedKey(statement) : 0L);
}
- private ExecuteQueryResult createQueryResult(final ResultSet resultSet, final ConnectionMode connectionMode) throws SQLException {
+ private QueryResult createQueryResult(final ResultSet resultSet, final ConnectionMode connectionMode) throws SQLException {
return connectionMode == ConnectionMode.MEMORY_STRICTLY ? new StreamJDBCQueryResult(resultSet) : new MemoryJDBCQueryResult(resultSet);
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/RawProxyExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/RawProxyExecutor.java
index bc5b0c5..8d688cc 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/RawProxyExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/engine/jdbc/RawProxyExecutor.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.RawSQLExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.raw.callback.RawSQLExecutorCallback;
import org.apache.shardingsphere.infra.executor.sql.execute.result.ExecuteResult;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.update.ExecuteUpdateResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.update.UpdateResult;
import org.apache.shardingsphere.infra.executor.sql.execute.engine.SQLExecutorExceptionHandler;
import java.sql.SQLException;
@@ -54,10 +54,10 @@ public final class RawProxyExecutor {
List<ExecuteResult> results = doExecute(executionGroups, null, callback);
// TODO refresh metadata
if (null == results || results.isEmpty() || null == results.get(0)) {
- return Collections.singleton(new ExecuteUpdateResult(0, 0L));
+ return Collections.singleton(new UpdateResult(0, 0L));
}
// CHECKSTYLE:OFF
- if (results.get(0) instanceof ExecuteUpdateResult) {
+ if (results.get(0) instanceof UpdateResult) {
// TODO refresh metadata
}
// CHECKSTYLE:ON
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilder.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilder.java
index a2a37c0..ef5b897 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilder.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilder.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.Projecti
import org.apache.shardingsphere.infra.binder.segment.select.projection.ProjectionsContext;
import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.ColumnProjection;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryHeader;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.schema.model.TableMetaData;
import org.apache.shardingsphere.infra.rule.type.DataNodeContainedRule;
@@ -40,34 +40,33 @@ public final class QueryHeaderBuilder {
/**
* Build query header builder.
*
- * @param executeQueryResult execute query result
+ * @param queryResult query result
* @param metaData meta data name
* @param columnIndex column index
* @return query header
* @throws SQLException SQL exception
*/
- public static QueryHeader build(final ExecuteQueryResult executeQueryResult, final ShardingSphereMetaData metaData, final int columnIndex) throws SQLException {
- return build(executeQueryResult, metaData, executeQueryResult.getColumnName(columnIndex), columnIndex);
+ public static QueryHeader build(final QueryResult queryResult, final ShardingSphereMetaData metaData, final int columnIndex) throws SQLException {
+ return build(queryResult, metaData, queryResult.getColumnName(columnIndex), columnIndex);
}
/**
* Build query header builder.
*
* @param projectionsContext projections context
- * @param executeQueryResult execute query result
+ * @param queryResult query result
* @param metaData meta data name
* @param columnIndex column index
* @return query header
* @throws SQLException SQL exception
*/
- public static QueryHeader build(final ProjectionsContext projectionsContext,
- final ExecuteQueryResult executeQueryResult, final ShardingSphereMetaData metaData, final int columnIndex) throws SQLException {
- return build(executeQueryResult, metaData, getColumnName(projectionsContext, executeQueryResult, columnIndex), columnIndex);
+ public static QueryHeader build(final ProjectionsContext projectionsContext, final QueryResult queryResult, final ShardingSphereMetaData metaData, final int columnIndex) throws SQLException {
+ return build(queryResult, metaData, getColumnName(projectionsContext, queryResult, columnIndex), columnIndex);
}
- private static QueryHeader build(final ExecuteQueryResult executeQueryResult, final ShardingSphereMetaData metaData, final String columnName, final int columnIndex) throws SQLException {
+ private static QueryHeader build(final QueryResult queryResult, final ShardingSphereMetaData metaData, final String columnName, final int columnIndex) throws SQLException {
String schemaName = metaData.getName();
- String actualTableName = executeQueryResult.getTableName(columnIndex);
+ String actualTableName = queryResult.getTableName(columnIndex);
Optional<DataNodeContainedRule> dataNodeContainedRule =
metaData.getRuleMetaData().getRules().stream().filter(each -> each instanceof DataNodeContainedRule).findFirst().map(rule -> (DataNodeContainedRule) rule);
String tableName;
@@ -80,18 +79,18 @@ public final class QueryHeaderBuilder {
tableName = actualTableName;
primaryKey = false;
}
- String columnLabel = executeQueryResult.getColumnLabel(columnIndex);
- int columnLength = executeQueryResult.getColumnLength(columnIndex);
- int columnType = executeQueryResult.getColumnType(columnIndex);
- int decimals = executeQueryResult.getDecimals(columnIndex);
- boolean signed = executeQueryResult.isSigned(columnIndex);
- boolean notNull = executeQueryResult.isNotNull(columnIndex);
- boolean autoIncrement = executeQueryResult.isAutoIncrement(columnIndex);
+ String columnLabel = queryResult.getColumnLabel(columnIndex);
+ int columnLength = queryResult.getColumnLength(columnIndex);
+ int columnType = queryResult.getColumnType(columnIndex);
+ int decimals = queryResult.getDecimals(columnIndex);
+ boolean signed = queryResult.isSigned(columnIndex);
+ boolean notNull = queryResult.isNotNull(columnIndex);
+ boolean autoIncrement = queryResult.isAutoIncrement(columnIndex);
return new QueryHeader(schemaName, tableName, columnLabel, columnName, columnLength, columnType, decimals, signed, primaryKey, notNull, autoIncrement);
}
- private static String getColumnName(final ProjectionsContext projectionsContext, final ExecuteQueryResult executeQueryResult, final int columnIndex) throws SQLException {
+ private static String getColumnName(final ProjectionsContext projectionsContext, final QueryResult queryResult, final int columnIndex) throws SQLException {
Projection projection = projectionsContext.getExpandProjections().get(columnIndex - 1);
- return projection instanceof ColumnProjection ? ((ColumnProjection) projection).getName() : executeQueryResult.getColumnName(columnIndex);
+ return projection instanceof ColumnProjection ? ((ColumnProjection) projection).getName() : queryResult.getColumnName(columnIndex);
}
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryResponse.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryResponse.java
index 2376917..415593d 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryResponse.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/query/QueryResponse.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.backend.response.query;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryHeader;
import org.apache.shardingsphere.proxy.backend.response.BackendResponse;
@@ -35,5 +35,5 @@ public final class QueryResponse implements BackendResponse {
private final List<QueryHeader> queryHeaders;
- private final List<ExecuteQueryResult> queryResults = new LinkedList<>();
+ private final List<QueryResult> queryResults = new LinkedList<>();
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/update/UpdateResponse.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/update/UpdateResponse.java
index 4664bc3..eb94903 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/update/UpdateResponse.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/response/update/UpdateResponse.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.proxy.backend.response.update;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.infra.executor.sql.execute.result.ExecuteResult;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.update.ExecuteUpdateResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.update.UpdateResult;
import org.apache.shardingsphere.proxy.backend.response.BackendResponse;
import java.util.Collection;
@@ -51,8 +51,8 @@ public final class UpdateResponse implements BackendResponse {
public UpdateResponse(final Collection<ExecuteResult> executeResults) {
for (ExecuteResult each : executeResults) {
- updateCount = ((ExecuteUpdateResult) each).getUpdateCount();
- updateCounts.add(((ExecuteUpdateResult) each).getUpdateCount());
+ updateCount = ((UpdateResult) each).getUpdateCount();
+ updateCounts.add(((UpdateResult) each).getUpdateCount());
}
lastInsertId = getLastInsertId(executeResults);
}
@@ -60,7 +60,7 @@ public final class UpdateResponse implements BackendResponse {
private long getLastInsertId(final Collection<ExecuteResult> executeResults) {
long result = 0;
for (ExecuteResult each : executeResults) {
- result = Math.max(result, ((ExecuteUpdateResult) each).getLastInsertId());
+ result = Math.max(result, ((UpdateResult) each).getLastInsertId());
}
return result;
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java
index 33ac155..8251ff2 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/ShowTablesBackendHandler.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.proxy.backend.text.admin;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.raw.QueryResultRow;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.raw.RawQueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.raw.metadata.QueryResultMetaData;
@@ -58,7 +58,7 @@ public final class ShowTablesBackendHandler implements TextProtocolBackendHandle
null, result.getQueryHeaders().get(0).getColumnName(), result.getQueryHeaders().get(0).getColumnLabel(), Types.VARCHAR, "VARCHAR", 255, 0, false, false, false)));
Collection<String> allTableNames = ProxyContext.getInstance().getMetaData(backendConnection.getSchemaName()).getSchema().getAllTableNames();
List<QueryResultRow> rows = allTableNames.stream().map(each -> new QueryResultRow(Collections.singletonList(each))).collect(Collectors.toList());
- ExecuteQueryResult queryResult = new RawQueryResult(metaData, rows);
+ QueryResult queryResult = new RawQueryResult(metaData, rows);
result.getQueryResults().add(queryResult);
queryResponse = result;
return result;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilderTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilderTest.java
index f04b27d..5421db4 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilderTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/query/QueryHeaderBuilderTest.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.Col
import org.apache.shardingsphere.infra.binder.segment.select.projection.impl.ExpressionProjection;
import org.apache.shardingsphere.infra.database.metadata.DataSourceMetaData;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryHeader;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.resource.DataSourcesMetaData;
import org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
@@ -49,79 +49,79 @@ public final class QueryHeaderBuilderTest {
@Test
public void assertQueryHeaderSchema() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertThat(header.getSchema(), is("sharding_schema"));
}
@Test
public void assertQueryHeaderTable() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertThat(header.getTable(), is("t_logic_order"));
}
@Test
public void assertQueryHeaderColumnLabel() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertThat(header.getColumnLabel(), is("order_id"));
}
@Test
public void assertQueryHeaderColumnNameWithoutProjectionsContext() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertThat(header.getColumnName(), is("order_id"));
}
@Test
public void assertQueryHeaderColumnNameFromProjectionsContext() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createProjectionsContext(), createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createProjectionsContext(), createQueryResult(), createMetaData(), 1);
assertThat(header.getColumnName(), is("order_id"));
}
@Test
public void assertQueryHeaderColumnNameFromMetaData() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createProjectionsContext(), createExecuteQueryResult(), createMetaData(), 2);
+ QueryHeader header = QueryHeaderBuilder.build(createProjectionsContext(), createQueryResult(), createMetaData(), 2);
assertThat(header.getColumnName(), is("expr"));
}
@Test
public void assertQueryHeaderColumnLength() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertThat(header.getColumnLength(), is(1));
}
@Test
public void assertQueryHeaderColumnType() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertThat(header.getColumnType(), is(Types.INTEGER));
}
@Test
public void assertQueryHeaderDecimals() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertThat(header.getDecimals(), is(1));
}
@Test
public void assertQueryHeaderSigned() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertTrue(header.isSigned());
}
@Test
public void assertQueryHeaderPrimaryKey() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertTrue(header.isPrimaryKey());
}
@Test
public void assertQueryHeaderNotNull() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertTrue(header.isNotNull());
}
@Test
public void assertQueryHeaderAutoIncrement() throws SQLException {
- QueryHeader header = QueryHeaderBuilder.build(createExecuteQueryResult(), createMetaData(), 1);
+ QueryHeader header = QueryHeaderBuilder.build(createQueryResult(), createMetaData(), 1);
assertTrue(header.isAutoIncrement());
}
@@ -145,8 +145,8 @@ public final class QueryHeaderBuilderTest {
return new ProjectionsContext(0, 0, false, Arrays.asList(new ColumnProjection("o", "order_id", "id"), new ExpressionProjection("o.order_id + 1", "expr")));
}
- private ExecuteQueryResult createExecuteQueryResult() throws SQLException {
- ExecuteQueryResult result = mock(ExecuteQueryResult.class);
+ private QueryResult createQueryResult() throws SQLException {
+ QueryResult result = mock(QueryResult.class);
when(result.getTableName(1)).thenReturn("t_order");
when(result.getColumnLabel(1)).thenReturn("order_id");
when(result.getColumnName(1)).thenReturn("order_id");
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
index 0aa81f0..84de2e0 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
@@ -29,7 +29,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bin
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.text.PostgreSQLDataRowPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLCommandCompletePacket;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryHeader;
import org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine;
import org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine;
@@ -107,7 +107,7 @@ public final class PostgreSQLComBindExecutor implements QueryCommandExecutor {
private Collection<PostgreSQLColumnDescription> createColumnDescriptions(final QueryResponse queryResponse) throws SQLException {
Collection<PostgreSQLColumnDescription> result = new LinkedList<>();
- List<ExecuteQueryResult> queryResults = queryResponse.getQueryResults();
+ List<QueryResult> queryResults = queryResponse.getQueryResults();
int columnIndex = 0;
for (QueryHeader each : queryResponse.getQueryHeaders()) {
String columnTypeName = queryResults.isEmpty() ? null : queryResults.get(0).getColumnTypeName(columnIndex + 1);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java
index 3eb8c73..cbc94a3 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.tex
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.text.PostgreSQLDataRowPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLCommandCompletePacket;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
-import org.apache.shardingsphere.infra.executor.sql.execute.result.query.ExecuteQueryResult;
+import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryHeader;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
import org.apache.shardingsphere.proxy.backend.response.BackendResponse;
@@ -82,7 +82,7 @@ public final class PostgreSQLComQueryExecutor implements QueryCommandExecutor {
private Collection<PostgreSQLColumnDescription> createColumnDescriptions(final QueryResponse queryResponse) throws SQLException {
Collection<PostgreSQLColumnDescription> result = new LinkedList<>();
- List<ExecuteQueryResult> queryResults = queryResponse.getQueryResults();
+ List<QueryResult> queryResults = queryResponse.getQueryResults();
int columnIndex = 0;
for (QueryHeader each : queryResponse.getQueryHeaders()) {
String columnTypeName = queryResults.isEmpty() ? null : queryResults.get(0).getColumnTypeName(columnIndex + 1);