Add Spectator Histogram SQL functions#18885
Merged
jtuglu1 merged 3 commits intoapache:masterfrom Jan 7, 2026
Merged
Conversation
...java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramPercentileSqlAggregator.java
Fixed
Show fixed
Hide fixed
...java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramPercentileSqlAggregator.java
Fixed
Show fixed
Hide fixed
...java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramPercentileSqlAggregator.java
Fixed
Show fixed
Hide fixed
| .buildMMappedIndex(); | ||
|
|
||
| return walker.add( | ||
| DataSegment.builder() |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
3beeb2d to
ba5d493
Compare
ba5d493 to
1c9f2ed
Compare
1c9f2ed to
cccacaf
Compare
bsyk
reviewed
Jan 6, 2026
bsyk
approved these changes
Jan 6, 2026
jtuglu1
commented
Jan 6, 2026
e39924b to
b8369f2
Compare
b8369f2 to
a6be0c7
Compare
jasonk000
reviewed
Jan 6, 2026
...rc/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramCountPostAggregator.java
Outdated
Show resolved
Hide resolved
...java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramPercentileSqlAggregator.java
Show resolved
Hide resolved
...java/org/apache/druid/spectator/histogram/sql/SpectatorHistogramPercentileSqlAggregator.java
Show resolved
Hide resolved
jasonk000
approved these changes
Jan 6, 2026
maytasm
approved these changes
Jan 7, 2026
| */ | ||
| public class SpectatorHistogramCountSqlAggregator implements SqlAggregator | ||
| { | ||
| private static final SqlAggFunction FUNCTION_INSTANCE = new SpectatorHistogramCountSqlAggFunction(); |
Contributor
There was a problem hiding this comment.
nit: use OperatorConversions.aggregatorBuilder (easier to read compare to SqlAggFunction's constructor)
| */ | ||
| public class SpectatorHistogramPercentileSqlAggregator implements SqlAggregator | ||
| { | ||
| private static final SqlAggFunction FUNCTION_INSTANCE = new SpectatorHistogramPercentileSqlAggFunction(); |
Contributor
There was a problem hiding this comment.
nit: use OperatorConversions.aggregatorBuilder (easier to read compare to SqlAggFunction's constructor)
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.
Description
Adds Spectator SQL functions:
SPECTATOR_COUNTreturns the # of distinct events inside the histogram (either pre/post aggregated).SPECTATOR_PERCENTILEallows computing single/multiple percentiles over a histogram column (either pre/post aggregated).Release note
Add
SPECTATOR_COUNTandSPECTATOR_PERCENTILESQL functions for operating on Spectator Histograms.This PR has: