Skip to content
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

Merged
merged 1 commit into from
Sep 16, 2019
Merged

Conversation

oxtoacart
Copy link
Contributor

This fix allows queries to use PERCENTILE expressions that wrap existing PERCENTILEs.

@oxtoacart oxtoacart requested a review from hwh33 September 16, 2019 02:40
"github.com/getlantern/msgpack"
)

// PERCENTILEOPT returns an optimized PERCENTILE that wraps an existing
// PERCENTILE and reuses its storage.
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@hwh33 hwh33 left a 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

@oxtoacart
Copy link
Contributor Author

Thanks @hwh33!

@oxtoacart oxtoacart merged commit 7b3204c into master Sep 16, 2019
@oxtoacart oxtoacart deleted the ox/percentilefix3 branch September 16, 2019 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants