You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/06/13 07:54:17 UTC

[shardingsphere] branch master updated: 10374 - code refactoring for process report feature (#10676)

This is an automated email from the ASF dual-hosted git repository.

panjuan 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 b208758  10374 - code refactoring for process report feature (#10676)
b208758 is described below

commit b2087582c3becc3e075973ef21cc495d04610baf
Author: Siva Tharun Kola <Si...@users.noreply.github.com>
AuthorDate: Sun Jun 13 13:23:44 2021 +0530

    10374 - code refactoring for process report feature (#10676)
    
    * 10374 - code refactoring for process report feature
    
    - replaced the if condition with ternary operator and used collection utils and objects class for null check
    
    * Improve Federate metadata (#10674)
    
    * Improve Federate metadata
    
    * java doc
    
    * java doc
    
    * Create FederateRefresher (#10675)
    
    * Refactor MetadataRefreshEngine (#10677)
    
    * Refactor MetadataRefreshEngine
    
    * FIX TESTS
    
    * Merge rewrite-test module (#10682)
    
    * Adjust sequence of pom order for feature import
    
    * Merge rewrite-test module
    
    * Merge rewrite-test module
    
    * Merge shardingsphere-infra-rewrite and shardingsphere-infra-rewrite-engine module (#10684)
    
    * Merge shardingsphere-infra-rewrite and shardingsphere-infra-rewrite-engine module
    
    * Merge shardingsphere-infra-rewrite and shardingsphere-infra-rewrite-engine module
    
    * Modify SqlConformanceEnum (#10687)
    
    * Modify SqlConformanceEnum
    
    * Refactor MetadataRefreshEngine
    
    * fix datasource config error for #10584 (#10683)
    
    * PostgreSQL supports unspecified type (#10691)
    
    * fix create sharding table rule error (#10698)
    
    * fix create sharding table rule error
    
    * fix test case
    
    * Fix POSTGRESQL_TYPE_CHAR not found in column type (#10704)
    
    * Fix POSTGRESQL_TYPE_CHAR not found in column type
    
    * Complete test case
    
    * Correct PostgreSQL Bind Packet data row type (#10706)
    
    * Adjust datatype (#10681)
    
    * Adjust the shadow data type boolean to Boolean
    
    * Adjust the shadow data type boolean to Boolean
    
    * Remove useless constructor of AlgorithmProvidedShardingRuleConfiguration (#10707)
    
    * Remove useless constructor of AlgorithmProvidedShardingRuleConfiguration
    
    * Remove useless constructor of AlgorithmProvidedShardingRuleConfiguration
    
    * Refactor scaling integration test (#10705)
    
    * Refactor scaling it
    
    * For checkstyle
    
    * Fix ci
    
    * Remove useless generic definition of RuleBuilder (#10708)
    
    * Fix javadoc
    
    * Fix javadoc
    
    * Remove useless generic definition of RuleBuilder
    
    * Remove useless check with new ShardingRule (#10709)
    
    * For code format
    
    * Remove useless check with new ShardingRule
    
    * Correct packages and generic types (#10710)
    
    * Add same order check for OrderedSPIRegistry (#10712)
    
    * Check sharding algorithm for create & alter sharding table rule (#10711)
    
    * Check sharding algorithm for create & alter sharding table rule
    
    * Check sharding algorithm for create & alter sharding table rule
    
    * Check sharding algorithm for create & alter sharding table rule
    
    * Check sharding algorithm for create & alter sharding table rule
    
    * Check sharding algorithm for create & alter sharding table rule
    
    * Check sharding algorithm for create & alter sharding table rule
    
    * fix create user password parse error (#10713)
    
    * fix create user password parse error
    
    * modify visit class
    
    * Check key generator for create & alter sharding table rule (#10718)
    
    * Check key generator for create & alter sharding table rule
    
    * Check key generator for create & alter sharding table rule
    
    * Add test for LocalTransactionManager  (#10701)
    
    * Add test for LocalTransactionManager
    
    * fix by  comments
    
    * fix code style
    
    * fix test case
    
    * fix test case
    
    * Add test for LocalTransactionManager
    
    * fix by  comments
    
    * fix code style
    
    * fix test case
    
    * fix test case
    
    * fix test case
    
    * fix test case
    
    * fix test case
    
    * Retrieve federated execution from jdbc statement and proxy statement. (#10720)
    
    * Retrieve federated execution from jdbc statement and proxy statement.
    
    * reverse
    
    * fix close()
    
    * get results
    
    * Update FAQ for compiling errors (#10721)
    
    * Update documents for Proxy authentication (#10722)
    
    * Update documents for Proxy authentication
    
    * Update proxy documents in dev manual
    
    * Add with clause for Oracle `SELECT` statement (#10558)
    
    * add definition for with clause
    
    * add start, stop indices for subquery segment
    
    * modify alias rule
    
    * add with clause test cases
    
    * add new rule to predicate
    
    * Add Oracle SQL - SET CONSTRAINTS (#10685)
    
    * optimize some calcite select error (#10719)
    
    * optimize calcite select logic
    
    * fix test case error
    
    * fix NPE
    
    * extract trim semicolon to sql util class
    
    * fix checkstyle
    
    * fix sql join error with multi unbinding sharding table (#10728)
    
    * Update FAQ for compiling error (#10726)
    
    * feat: add contributor over time graph to README (#10451)
    
    * Update readme and doc with contributor graph (#10730)
    
    * Update readme
    
    * Update doc
    
    * Standardization feature order usage (#10733)
    
    * Use standard ShardingOrder
    
    * Use standard readwrite-splitting order
    
    * Use standard db-discovery order
    
    * Use standard encrypt order
    
    * optimize calcite parameter pass (#10731)
    
    * Fix typos in FAQ and proxy authentication (#10738)
    
    * Code format for authority (#10739)
    
    * Refactor PostgreSQL Proxy (#10736)
    
    * Refactor PostgreSQL Proxy
    
    * Fix empty SQL cause NPE
    
    * Fix empty SQL parsing error
    
    * Fix checkstyle
    
    * Fix PostgreSQLComDescribeExecutorTest
    
    * Refactor PostgreSQL Proxy protocol
    
    * Fix no data packet may be missing
    
    * Fix get Optional class mistake
    
    * Fix SQL command not found
    
    * Fix PostgreSQL frontend test cases
    
    * Add PostgreSQLNoDataPacketTest
    
    * Replace ThreadLocal with ConnectionContextRegistry
    
    * Fix checkstyle
    
    * Fix test case
    
    * Polish test case
    
    * Update maven and docker image status (#10741)
    
    * Code format for authority
    
    * Update maven status
    
    * Update docker image status
    
    * Add default user (#10740)
    
    * Fix RowDescription absence when Bind binary formats (#10743)
    
    * Add test case for RuleConfigurationCheckerFactory with RuleConfigurationChecker fixture (#10742)
    
    * Add test case for RuleConfigurationCheckerFactory with RuleConfigurationChecker fixture
    
    * Add test case for RuleConfigurationCheckerFactory with RuleConfigurationChecker fixture
    
    * Rename YamlRuleConfigurationSwapperFixture with proxy module (#10744)
    
    * Rename YamlRuleConfigurationFixture with proxy module
    
    * Rename YamlRuleConfigurationSwapperFixture with proxy module
    
    * Rename YamlRuleConfigurationSwapperFixture with proxy module
    
    * fix index validate and show logic (#10747)
    
    * fix index validate and show logic
    
    * fix checkstyle
    
    * PostgreSQL CommandCompletion return actual rows (#10748)
    
    * Minor refactor CreateSharidngTableRuleBackendHandler (#10749)
    
    * Minor refactor CreateShardingTableRuleBackendHandler
    
    * Minor refactor CreateShardingTableRuleBackendHandler
    
    * modify doc for IntervalShardingAlgorithm (#10753)
    
    * Check duplicate binding tables (#10754)
    
    * Remove useless codes (#10756)
    
    * Add test case for ShardingRuleConfigurationChecker & AlgorithmProvidedShardingRuleConfigurationChecker (#10755)
    
    * Add test case for RuleConfigurationCheckerFactory with RuleConfigurationChecker fixture
    
    * add test case
    
    * Refactor Oracle DDL test cases (#10752)
    
    * fix calcite select result merge error when call execute method (#10758)
    
    * fix calcite select result merge error when call execute method
    
    * fix test case
    
    * Create AlterTableStatementFederateRefresher #10696 (#10757)
    
    * Create AlterTableStatementFederateRefresher #10696
    
    * Fix failed unit test for MetadataRefresherFactory
    
    * add final modifier for AlterTableStatementFederateRefresher
    
    * Add GlobalRuleConfiguration and SchemaRuleConfiguration interfaces (#10763)
    
    * Refactor GovernanceShardingSphereDataSource
    
    * Add GlobalRuleConfiguration and SchemaRuleConfiguration interfaces
    
    * optimize select statement that in same datasource route logic (#10762)
    
    * optimize select statement that in same datasource route logic
    
    * optimize broadcast tables route logic
    
    * update sharding document (#10766)
    
    * update sharding document
    
    * update sharding document
    
    * fix UnsupportedOperationException when execute ConcurrentHashMap.keySet().addAll() (#10767)
    
    * Add more assertions in MetaDataChangedWatcherTest (#10765)
    
    * Rename RDLStatement.rules fields (#10769)
    
    * Add AlterRDLStatement (#10772)
    
    * Refactor AlterShardingBindingTableRulesStatement
    
    * Refactor AlterShardingBroadcastTableRulesStatement
    
    * Refactor AlterShardingTableRuleStatement
    
    * Refactor CreateShardingBindingTableRulesStatement
    
    * Refactor CreateShardingBroadcastTableRulesStatement
    
    * Refactor CreateShardingTableRuleStatement
    
    * Refactor DropDatabaseDiscoveryRuleStatement
    
    * Refactor DropReadwriteSplittingRuleStatement
    
    * Refactor DropResourceStatement
    
    * Refactor DropShardingTableRuleStatement
    
    * Add AlterRDLStatement
    
    * Add AlterRDLStatement
    
    * Fix columns' format may be incorrect in PostgreSQL DataRow (#10774)
    
    * Fix columns' format may be incorrect in PostgreSQL DataRow
    
    * Add javadoc for new method
    
    * Format codes
    
    * Polish structure of RDL and RQL statement (#10775)
    
    * move AddResourceStatement and DropResourceStatement
    
    * Rename DropRuleStatement
    
    * Rename CreateRuleStatement
    
    * Rename AlterRuleStatement
    
    * Refactor package for rql
    
    * Fix test case
    
    * Fix test case
    
    * Fix test case
    
    * Fix test case
    
    * Minor refactor encrypt rule RDL (#10776)
    
    * Check duplicate binding tables
    
    * Minor refactor create encrypt rule
    
    * Add test case for RuleConfigurationChecker (#10770)
    
    * add test case for RuleConfigurationChecker
    
    * fix code style
    
    * Revise #10770 (#10777)
    
    * Add test case for RuleConfigurationChecker (#10778)
    
    * add test case for RuleConfigurationChecker
    
    * fix code style
    
    * Revise #10778 for code format (#10779)
    
    * Refactor document for DistSQL (#10771)
    
    * Check duplicate binding tables
    
    * Refactor document for DistSQL
    
    * Remove useless to phase parse for DistSQL (#10780)
    
    * Fix format of docs (#10781)
    
    * Update DistSQL title for English version and sequence of nav (#10783)
    
    * Update DistSQL title for English version
    
    * Fix sequence of DistSQL nav
    
    * for code format (#10782)
    
    * Fix #10536 with code format (#10784)
    
    * #Fixes #10771 with Chinese word in doc (#10785)
    
    * Add : add sysbench benchmark link (#10786)
    
    * Add DistRuleSQLParserFacade to prepare SPI with rule SQL parser (#10788)
    
    * Refactor DistSQLStatementParserEngine
    
    * Add DistRuleSQLParserFacade SPI
    
    * Refactor SQLParserFactory
    
    * Update release note (#10790)
    
    * Modify SqlConformanceEnum
    
    * Refactor MetadataRefreshEngine
    
    * Update RELEASE-NOTES
    
    * add milestone
    
    * add change log
    
    * update example pom (#10791)
    
    * Add DatabaseTypedSQLParserFacade and FeatureTypedSQLParserFacade for SQL parser (#10792)
    
    * Add DatabaseTypedSQLParserFacade
    
    * Rename FeatureTypedSQLParserFacade
    
    * Fix compile error
    
    * Update docs
    
    * Add Oracle SQl - ANALYZE (#10768)
    
    * Refactor SQLParserFactory to adapt SQL parser and Dist SQL parser (#10793)
    
    * Use static instead of singleton for DatabaseTypedSQLParserFacadeRegistry (#10794)
    
    * Polish sql parser package (#10795)
    
    * Add test case for ParseASTNode (#10797)
    
    * Use SPI to introduce DistSQL visitor (#10798)
    
    * Refactor DistSQLStatementParserEngine
    
    * Add FeatureTypedParseASTNode
    
    * Add FeatureTypedSQLVisitorFacade
    
    * 10374 - added the missing import for Objects class
    
    Co-authored-by: Juan Pan(Trista) <pa...@apache.org>
    Co-authored-by: Liang Zhang <te...@163.com>
    Co-authored-by: Raigor <ra...@gmail.com>
    Co-authored-by: 吴伟杰 <wu...@apache.org>
    Co-authored-by: Zhengqiang Duan <st...@gmail.com>
    Co-authored-by: verysu <25...@qq.com>
    Co-authored-by: avalon5666 <64...@users.noreply.github.com>
    Co-authored-by: Haoran Meng <me...@gmail.com>
    Co-authored-by: Da Xiang Huang <lo...@foxmail.com>
    Co-authored-by: Thanoshan MV <48...@users.noreply.github.com>
    Co-authored-by: Liangda-w <66...@users.noreply.github.com>
    Co-authored-by: Shuyang Wu <wo...@gmail.com>
    Co-authored-by: Zhu jun <zh...@163.com>
    Co-authored-by: MingxingLAI <80...@users.noreply.github.com>
    Co-authored-by: 孙念君 Sun Nianjun <ka...@outlook.com>
---
 .../infra/executor/sql/execute/engine/raw/RawExecutor.java        | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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 3e530b7..c6dd020 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
@@ -18,6 +18,7 @@
 package org.apache.shardingsphere.infra.executor.sql.execute.engine.raw;
 
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
 import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
 import org.apache.shardingsphere.infra.executor.kernel.ExecutorEngine;
@@ -30,6 +31,7 @@ import org.apache.shardingsphere.infra.executor.sql.execute.result.update.Update
 import java.sql.SQLException;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Objects;
 import java.util.List;
 import org.apache.shardingsphere.infra.executor.sql.process.ExecuteProcessEngine;
 
@@ -62,10 +64,8 @@ public final class RawExecutor {
             // TODO Load query header for first query
             List<ExecuteResult> results = execute(executionGroupContext, (RawSQLExecutorCallback) null, callback);
             ExecuteProcessEngine.finish(executionGroupContext.getExecutionID());
-            if (null == results || results.isEmpty() || null == results.get(0)) {
-                return Collections.singleton(new UpdateResult(0, 0L));
-            }
-            return results;
+            return CollectionUtils.isEmpty(results) || Objects.isNull(results.get(0)) ? Collections
+                .singleton(new UpdateResult(0, 0L)) : results;
         } finally {
             ExecuteProcessEngine.clean();
         }