Bring CalciteBinCommandIT and CalciteMultisearchCommandIT to parity on the analytics-engine route#5551
Merged
ahkcs merged 1 commit intoJun 15, 2026
Conversation
…n the analytics-engine route Skip the analytics-route divergences in both ITs behind assumeNotAnalytics(...) and the gradle exclude list, mirroring the CalciteWhereCommandIT pattern. CalciteBinCommandIT (4 tests): bin on a time field then grouping by it (bin <timefield> bins=N | stats ... by <timefield>) diverges — the date-histogram bucket column is typed string (not timestamp) and the route produces a different bucket set (auto-histogram span / empty-bucket filtering differ), so both schema and row counts diverge. CalciteMultisearchCommandIT (4 tests): same-index subsearch conflation (every subsearch executes the first subsearch's filter, producing wrong counts) on 3 tests, and merged-column-order divergence over heterogeneous indices on 1. Both are analytics-engine behaviors, recorded as AnalyticsRouteLimitation constants. The v2/Calcite path is unchanged — all tests still run and pass there. Signed-off-by: Kai Huang <ahkcs@amazon.com>
Swiddis
approved these changes
Jun 15, 2026
This was referenced Jun 16, 2026
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
Brings
CalciteBinCommandITandCalciteMultisearchCommandITto parity on the analytics-engine route (:integ-test:integTestRemote -Dtests.analytics.parquet_indices=true): 8 failing → 0, by skipping the tests that exercise behavior the route inherently diverges on, behindassumeNotAnalytics(...)plus the gradle exclude list (same pattern as #5546). All skips are no-ops off the analytics route, so the v2 / Calcite path is unchanged.Each skip reason is recorded as an
AnalyticsRouteLimitationconstant (the single greppable registry introduced in #5546), and the excluded tests are listed in theanalyticsEnabledblock ofinteg-test/build.gradleso the AE-route skip set stays countable in one place.Pass rate
CalciteBinCommandITCalciteBinCommandIT:integ-test:integTest, fresh cluster)CalciteMultisearchCommandITCalciteMultisearchCommandIT:integ-test:integTest, fresh cluster)(Bin "run" counts exclude the 24 pre-existing
enabledOnlyWhenPushdownIsEnabled/pushdown skips that are unrelated to this change.)Documented skips (inherent analytics-route divergences)
CalciteBinCommandIT:testStatsWithBinsOnTimeField_Count,_Avg,testStatsWithBinsOnTimeAndTermField_Count,_Avgbin <timefield> bins=N | stats … by <timefield>diverges on the analytics route: the date-histogram bucket column comes back typedstringrather thantimestamp, and the route produces a different bucket set (different auto-histogram span / empty buckets not filtered), so both the schema type and the row counts differ. A plainly-projected@timestamp(not a histogram bucket) is unaffected on both routes.CalciteMultisearchCommandIT:testMultisearchWithThreeSubsearches,testMultisearchWithComplexAggregation,testMultisearchWithoutFurtherProcessingmultisearchsubsearch reads the same index, the analytics route applies the first subsearch's filter to all of them (each keeps its ownevallabel), so later subsearches silently return the first subsearch's rows → wrong counts. E.g. the three-subsearch case returns[22,California],[22,Illinois],[22,Tennessee](all get IL's count) instead of[17,CA],[22,IL],[25,TN].CalciteMultisearchCommandIT:testMultisearchWithTimestampInterleavingmultisearchover heterogeneous indices returns the merged columns in a different order than the v2/Calcite path (trailingvalue/timestampswapped). Values are correct; only the column order differs.Why skip instead of fix these in this PR?
These are skipped (not fixed) here for three reasons:
The defects are engine-side, not SQL-plugin. For every one of these tests the SQL-plugin lowering is correct — the Calcite
RelNodereaching the backend is identical regardless of which engine executes it (verified via/_plugins/_ppl/_explain). The divergence is entirely in the analytics-engine execution path (opensearch-project/OpenSearch, analytics-engine sandbox), so the fix belongs in that repo, not this one. This PR is SQL-side test parity.They are not one-line capability adds — they're scheduled engine work.
bins=Non a time field: the v2 path leans on OpenSearch's nativeauto_date_histogram(calendar-nice intervals,timestamp-typed output). The analytics route has no equivalent rewrite, so it runs the genericWIDTH_BUCKETUDF literally (raw equal-width buckets,string-typed label). Reaching parity needs a planner rewrite + a calendar-aware bucketing UDF — a feature, not a flag.The most impactful one is already tracked upstream. The same-index multisearch conflation is already captured by an
@AwaitsFixon the QA-sideMultisearchCommandIT.testMultisearchThreeBranchesByStr0in OpenSearch core, so the engine team already owns it. Landing the test skips here keeps the SQL-side suite green and consistent with that tracker rather than duplicating/forking the fix.The same-index multisearch conflation in particular is silent wrong results (no error, just incorrect counts) and is the highest-priority follow-up of the three.
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.