mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 18:13:32 -06:00
dont order for aggregate
This commit is contained in:
parent
dabfd88cd9
commit
aa830211fe
@ -151,11 +151,7 @@ export default class PostgresQuery {
|
|||||||
if (func === 'first' || func === 'last') {
|
if (func === 'first' || func === 'last') {
|
||||||
query = func + '(' + query + ',' + this.target.timeColumn + ')';
|
query = func + '(' + query + ',' + this.target.timeColumn + ')';
|
||||||
} else {
|
} else {
|
||||||
if (windows) {
|
query = func + '(' + query + ')';
|
||||||
query = func + '(' + query + ' ORDER BY ' + this.target.timeColumn + ')';
|
|
||||||
} else {
|
|
||||||
query = func + '(' + query + ')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'percentile':
|
case 'percentile':
|
||||||
|
@ -98,8 +98,8 @@ describe('PostgresQuery', function() {
|
|||||||
{ type: 'window', params: ['increase'] },
|
{ type: 'window', params: ['increase'] },
|
||||||
];
|
];
|
||||||
expect(query.buildValueColumn(column)).toBe(
|
expect(query.buildValueColumn(column)).toBe(
|
||||||
'(CASE WHEN max(v ORDER BY time) >= lag(max(v ORDER BY time)) OVER (PARTITION BY host ORDER BY time) ' +
|
'(CASE WHEN max(v) >= lag(max(v)) OVER (PARTITION BY host ORDER BY time) ' +
|
||||||
'THEN max(v ORDER BY time) - lag(max(v ORDER BY time)) OVER (PARTITION BY host ORDER BY time) ELSE max(v ORDER BY time) END) AS "a"'
|
'THEN max(v) - lag(max(v)) OVER (PARTITION BY host ORDER BY time) ELSE max(v) END) AS "a"'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user