Document that PPL fetch_size limits aggregation buckets - #5671
Open
ahkcs wants to merge 1 commit into
Open
Conversation
fetch_size applies to the final rows of the query, so on an aggregating query it limits the number of buckets returned rather than sampling documents. The existing docs described it only as a row limit, which reads as DSL size -- where aggregation results are returned in full. Contrast both DSL analogues: unlike terminate_after it does not corrupt aggregate values, and unlike size it does truncate aggregation results. Signed-off-by: Kai Huang <ahkcs@amazon.com>
ahkcs
requested review from
LantaoJin,
RyanL1997,
Swiddis,
acarbonetto,
anirudha,
dai-chen,
joshuali925,
mengweieric,
noCharger,
penghuo,
ps48,
qianheng-aws,
songkant-aws,
vamsimanohar,
ykmr1224 and
yuancu
as code owners
August 3, 2026 20:59
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Contributor
PR Code Suggestions ✨Explore these optional code suggestions:
|
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
fetch_sizeis applied to the final rows of a PPL query, so on an aggregating query it limits the number of aggregation buckets returned rather than sampling documents. The existing docs described it only as "limits the number of rows returned," which reads like DSLsize— where aggregation results come back in full.This adds a short section covering:
fetch_sizeis equivalent to appending| head <fetch_size>, so forstats/timechart/top/rare/patterns ... mode=aggregationit truncates buckets.terminate_after, which undercounts because documents are never collected. But unlike DSLsize, aggregation results are truncated. It matches neither analogue exactly, which is what made the behavior easy to misread.Raised in review of opensearch-project/OpenSearch-Dashboards#12511, where this behavior caused Discover to silently drop buckets from PPL visualizations.
Issues Resolved
None; documentation gap found during review of OpenSearch-Dashboards#12511.
Check List
Docs-only change.
docs/user/interfaces/is not covered by the doctest suite, so no queries here are executed as assertions; the example values were confirmed by hand against a local 3.8.0-SNAPSHOT cluster.