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

chengzhang 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 f3a19bbecca Fix sonar issue in GroupByMemoryMergedResult (#33478)
f3a19bbecca is described below

commit f3a19bbecca6be317bd8ed8d402fe528c2cd36b3
Author: Zhengqiang Duan <[email protected]>
AuthorDate: Thu Oct 31 13:47:29 2024 +0800

    Fix sonar issue in GroupByMemoryMergedResult (#33478)
---
 .../sharding/merge/dql/groupby/GroupByMemoryMergedResult.java           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
 
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
index b3dd5d75d83..56505af0f44 100644
--- 
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
+++ 
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResult.java
@@ -141,12 +141,12 @@ public final class GroupByMemoryMergedResult extends 
MemoryMergedResult<Sharding
     private List<MemoryQueryResultRow> getMemoryResultSetRows(final 
SelectStatementContext selectStatementContext,
                                                               final 
Map<GroupByValue, MemoryQueryResultRow> dataMap, final List<Boolean> 
valueCaseSensitive) {
         if (dataMap.isEmpty()) {
-            Object[] data = generateReturnData(selectStatementContext);
             boolean hasGroupBy = 
!selectStatementContext.getGroupByContext().getItems().isEmpty();
             boolean hasAggregations = 
!selectStatementContext.getProjectionsContext().getAggregationProjections().isEmpty();
             if (hasGroupBy || !hasAggregations) {
                 return Collections.emptyList();
             }
+            Object[] data = generateReturnData(selectStatementContext);
             return Collections.singletonList(new MemoryQueryResultRow(data));
         }
         List<MemoryQueryResultRow> result = new ArrayList<>(dataMap.values());

Reply via email to