P0.5 — elasticsql: enforce maxQueryResults no-LIMIT cap (join-safe)#128
Merged
Conversation
…Config.maxDocuments (join-safe) Close the advertised maxQueryResults quota gap for single-index SELECT … FROM idx with NO LIMIT. elasticsql-core = license-agnostic MECHANISM + Community baseline. - NEW ResultCapContext: thread-scoped applyResultCap suppress carrier (DynamicVariable, default = apply cap); consumed by softclient4es-arrow join legs. run(sql:String)/ ExtensionSpi.execute have no flag slot and the cap decision is synchronous-pre-Future, so a thread-local read sees what the leg executor / inbound-header middleware set. - Additive ResultTruncation + default-None truncation field on QueryRows/QueryStream/ QueryStructured (source-compatible; positional matches updated with `, _` — a custom 1-arg unapply is NOT Scala 2.12-safe). - CoreDqlExtension Community baseline: explicit-LIMIT>quota → 402 (unchanged); no-LIMIT + finite quota + fields.nonEmpty (mirrors SearchExecutor scroll-branch — aggregations/ SELECT * stay on bounded searchAsync) + not-suppressed → capped scroll via ScrollConfig.maxDocuments + ResultTruncation. resolveQuota seam for EnforcedDqlExtension. - NEW CoreDqlExtensionSpec (9 tests). + core/compile (2.12+2.13), 27 unit tests, headerCheck. Closed Issue #127 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… to include additional parameters
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.
Closes #127. Epic pricing-repackaging Phase 0, story P0.5 (leg 1 of 3: elasticsql-core).
What
Close the advertised
maxQueryResultsquota gap for single-indexSELECT … FROM idxqueries with NOLIMIT. elasticsql-core provides the license-agnostic MECHANISM + the Community baseline.Design (= ScrollConfig.maxDocuments mechanism + EnforcedDqlExtension + arrow join-leg suppression)
ResultCapContext— thread-scopedapplyResultCapsuppress carrier (DynamicVariable[Boolean], default = apply cap).run(sql:String)/ExtensionSpi.executehave no per-call flag slot and the cap decision runs synchronously before the first Future/ES boundary, so a thread-local read observes what the join-leg executor (local) / inbound-header middleware (federation) set aroundrun. Consumed by softclient4es-arrow (leg 3).ResultTruncation+ default-NonetruncationonQueryRows/QueryStream/QueryStructured— source-compatible (constructors unchanged; positional matches updated, _). A custom 1-argunapplywas rejected: not Scala 2.12-safe.CoreDqlExtensionCommunity baseline: explicit-LIMIT>quota → 402 (unchanged); no-LIMIT+ finite quota +fields.nonEmpty(mirrorsSearchExecutorscroll-branch — aggregations/SELECT *stay on boundedsearchAsync, never re-routed) + not-suppressed → capped scroll viaScrollConfig.maxDocuments+ResultTruncation.resolveQuotaseam lets the closedEnforcedDqlExtension(extensions leg) override to the licensed quota. NOT inject-LIMIT/flip-to-searchAsync(breaks Pro: 1M >index.max_result_window).Verification
+ core/compile(2.12 + 2.13), 9 newCoreDqlExtensionSpec+ 12LicenseExecutorSpec+ 5ResultRendererSpecgreen, headerCheck clean.Sibling PRs (same story)
EnforcedDqlExtension(licensed-quota override) — feature/P0.5LocalConnection+DownstreamConnectionheader + sidecar middleware) + BLOCKING join-correctness Docker test — feature/P0.5Note
softclient4es-jdbc has 5 positional
QueryResultpattern matches that will need, _at its next rebuild against this core SNAPSHOT (out of P0.5 scope, flagged).🤖 Generated with Claude Code