-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sum_bucket
aggregation
#156
Conversation
3ab8fe8
to
e188067
Compare
func (cw *ClickhouseQueryTranslator) parseSumBucket(queryMap QueryMap) (aggregationType model.QueryType, success bool) { | ||
sumBucketRaw, exists := queryMap["sum_bucket"] | ||
if !exists { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not we explicitly return result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know, seems shorter and easier to read for me this way
} | ||
if returnMap, ok := rows[0].LastColValue().(model.JsonMap); ok { | ||
return []model.JsonMap{returnMap} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that this else is redundant
return resultRows // maybe null? | ||
} | ||
qp := queryprocessor.NewQueryProcessor(query.ctx) | ||
parentFieldsCnt := len(parentRows[0].Cols) - 2 // -2, because row is [parent_cols..., current_key, current_value] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be negative value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should never be. Added a warn, though.
One second, I didn't change 1 thing after rebase. |
c0ae484
to
4d5017f
Compare
f13b7a0
to
60e6356
Compare
02f7650
to
6676224
Compare
Tests to this PR showed 2 issues in all pipeline aggregations:
But especially as those are issues in all types of pipeline aggr, I'd fix those in separate PR.
Some screens: