Skip to content

Commit 7bafa9b

Browse files
committed
[KNOWAGE-9160] change query behaviour from DISTINCT -> GROUP BY
1 parent 0bea38a commit 7bafa9b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

knowage-core/src/main/java/it/eng/spagobi/tools/dataset/strategy/AbstractJdbcEvaluationStrategy.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ protected IDataStore execute(List<AbstractSelectionField> projections, Filter fi
5050
IDataStore pagedDataStore;
5151

5252
try {
53-
SelectQuery selectQuery = new SelectQuery(dataSet).selectDistinct().select(projections).from(getTableName()).where(filter).groupBy(groups)
53+
List<AbstractSelectionField> effectiveGroups = (groups != null && !groups.isEmpty()) ? groups : projections;
54+
55+
SelectQuery selectQuery = new SelectQuery(dataSet).select(projections).from(getTableName()).where(filter).groupBy(effectiveGroups)
5456
.orderBy(sortings);
5557
pagedDataStore = getDataSource().executeStatement(selectQuery, offset, fetchSize, maxRowCount, true);
5658
pagedDataStore.setCacheDate(getDate());

0 commit comments

Comments
 (0)