From e3c49db537898d38def3e90c119e83934cce17d6 Mon Sep 17 00:00:00 2001 From: duanzhengqiang Date: Thu, 31 Oct 2024 13:43:54 +0800 Subject: [PATCH] Fix sonar issue in GroupByMemoryMergedResult --- .../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 b3dd5d75d8311..56505af0f4454 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 @@ private boolean getValueCaseSensitiveFromTables(final QueryResult queryResult, private List getMemoryResultSetRows(final SelectStatementContext selectStatementContext, final Map dataMap, final List 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 result = new ArrayList<>(dataMap.values());