Repository navigation
feat: add percentile_cont, percentile_disc and quantile aliases - #39
Merged
Merged
Conversation
QuestDB added exact percentile functions in questdb/questdb#6680: percentile_cont and percentile_disc, plus their quantile_cont and quantile_disc aliases. They work as aggregates and as whole-partition window functions. Add them to the aggregate function list so the web console highlights and autocompletes them. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
javier
pushed a commit
to questdb/documentation
that referenced
this pull request
Oct 23, 2026
## Summary Documents the exact percentile functions added in questdb/questdb#6680. - **Aggregate functions**: new `percentile_cont / quantile_cont` and `percentile_disc / quantile_disc` sections. They cover the single-percentile and `DOUBLE[]` multi-percentile forms, how each value is computed (SQL standard / PostgreSQL definitions), return types (`percentile_disc` returns `LONG` for integer input), NULL handling, and limitations (`FILL(LINEAR)`, constant fill on the array form, memory use per group). Both are added to the Statistical aggregates table. - **`approx_percentile`**: documents the new `DOUBLE[]` form and links to the exact functions. - **Window functions**: new `percentile_cont() / percentile_disc()` reference section (whole-partition only, constant percentile, not in live views) and a quick-reference row on the overview. - **Cookbook**: the query times histogram now uses one `percentile_disc` call over a percentile array with `UNNEST ... WITH ORDINALITY`, replacing ten `approx_percentile` calls and ten `UNION ALL` branches, and adds a non-cumulative variant using `lag()`. All result tables and documented behaviors were checked against a build of QuestDB master. ## Dependencies - questdb/sql-parser#39 adds the four function names to web console highlighting and autocomplete. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
javier
approved these changes
Oct 23, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
percentile_cont,percentile_disc,quantile_contandquantile_disctoaggregateFunctionsinsrc/grammar/functions.ts, in alphabetical order.SELECTexpression context and not in aWHEREpredicate, as for other aggregates.QuestDB added these functions in questdb/questdb#6680. They also work as window functions (
OVER (PARTITION BY ...)). Other functions that are both aggregate and window functions, such asavgandstddev, are listed only under aggregates, so this PR does the same.🤖 Generated with Claude Code