-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fixed optimized (wrapped) percentiles #84
Conversation
"github.com/getlantern/msgpack" | ||
) | ||
|
||
// PERCENTILEOPT returns an optimized PERCENTILE that wraps an existing | ||
// PERCENTILE and reuses its storage. |
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.
We no longer attempt to reuse the existing percentile's storage, we assume separate storage for this percentile.
Percentile Expr | ||
} | ||
|
||
func (e *ptileOptimized) Validate() error { |
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.
Most of this stuff is now inherited from ptile
.
defer wg.Done() | ||
|
||
sqlString := ` | ||
SELECT PERCENTILE(pp_5p, 90) AS pp_opt |
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.
This shows an example of what's now possible.
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.
Cool! Thanks also, the context is helpful.
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.
Looks good to me
Thanks @hwh33! |
This fix allows queries to use PERCENTILE expressions that wrap existing PERCENTILEs.