Skip to content

Commit

Permalink
no limits for streaming aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Mar 2, 2023
1 parent 597b2d1 commit f08fb3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const Sql = require('@cloki/clickhouse-sql')
* @param byWithoutName {string} name of the by_without token
*/
const applyViaStream = (token, query, counterFn, summarizeFn, lastValue, byWithoutName) => {
query.limit(undefined, undefined)
query.ctx.matrix = true
return _applyViaStream(token, timeShiftViaStream(token, query), counterFn, summarizeFn, lastValue, byWithoutName)
}

Expand Down Expand Up @@ -72,7 +74,6 @@ module.exports.genericRate = genericRate
*/
module.exports.rateStream = (token, query) => {
const duration = getDuration(token, query)
query.limit(undefined, undefined)
return applyViaStream(token, query, (sum) => {
sum = sum || 0
++sum
Expand Down
2 changes: 1 addition & 1 deletion parser/transpiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const { getPlg } = require('../plugins/engine')
const Sql = require('@cloki/clickhouse-sql')
const { simpleAnd } = require('./registry/stream_selector_operator_registry/stream_selector_operator_registry')
const logger = require('../lib/logger')
const { QrynBadRequest } = require('../common').errors
const { QrynBadRequest } = require('../lib/handlers/errors')

/**
* @param joinLabels {boolean}
Expand Down

0 comments on commit f08fb3c

Please sign in to comment.