Skip to content

Commit

Permalink
fix(data-vi): remove the LIMIT clause when using aggregate function…
Browse files Browse the repository at this point in the history
…s without dimensions (nocobase#6062)
  • Loading branch information
2013xile authored Jan 14, 2025
1 parent aa13199 commit 04d75cf
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,21 @@ export class QueryParser {
} = this.parseDimensions(ctx, dimensions, hasAgg, ctx.get?.('x-timezone'));
const order = this.parseOrders(ctx, orders, hasAgg);

const queryParams = {
where,
attributes: [...measureAttributes, ...dimensionAttributes],
include,
group,
order,
subQuery: false,
raw: true,
};
if (!hasAgg || dimensions.length) {
queryParams['limit'] = limit || 2000;
}
ctx.action.params.values = {
...ctx.action.params.values,
queryParams: {
where,
attributes: [...measureAttributes, ...dimensionAttributes],
include,
group,
order,
limit: limit || 2000,
subQuery: false,
raw: true,
},
queryParams,
fieldMap: { ...measureFieldMap, ...dimensionFieldMap },
};
await next();
Expand Down

0 comments on commit 04d75cf

Please sign in to comment.