Skip to content

Commit ddc0de2

Browse files
committed
fix code
1 parent 3a52bd7 commit ddc0de2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/aggregation.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ function aggrToSQL(expr) {
77
const { args, over } = expr
88
let str = exprToSQL(args.expr)
99
const fnName = expr.name
10-
let overStr = ''
10+
const overStr = over && `OVER (PARTITION BY ${over.map(col => identifierToSql(col)).join(', ')})`
1111

1212
if (fnName === 'COUNT') {
1313
if (has(args, 'distinct') && args.distinct !== null) str = `DISTINCT ${str}`
14-
if (over) overStr = `OVER (PARTITION BY ${over.map(col => identifierToSql(col)).join(', ')})`
1514
}
1615
return [`${fnName}(${str})`, overStr].filter(hasVal).join(' ')
1716
}

0 commit comments

Comments
 (0)