…ation
Brings the catch-up branch up to current upstream/main (4 commits since
this PR was opened) and current feature/mustang-ppl-integration (9
commits since this PR was opened), so the PR is mergeable into
feature/mustang-ppl-integration without conflicts.
Squashed (rather than two real merge commits) for the same DCO reason
the original commit was squashed: upstream commits authored by many
contributors with inconsistent or missing Signed-off-by trailers would
otherwise be brought into this PR's history.
Newer main commits absorbed (4):
- opensearch-project#5419 (LENGTH/REGEXP_REPLACE/DATE_TRUNC unified function spec)
- opensearch-project#5408 (datetime type normalization)
- opensearch-project#5414 (Gradle wrapper bump + @ignore exclusion)
- opensearch-project#5399 (FGAC-scoped SQL cursor continuation)
Newer feature commits absorbed (9):
- opensearch-project#5403 (analytics-engine optional dependency — major rewiring)
- opensearch-project#5407 (Carry CalciteEvalCommandIT through helper-managed index path)
- opensearch-project#5413 (Default plugins.calcite.enabled=true on unified path)
- opensearch-project#5415, opensearch-project#5416, opensearch-project#5417, opensearch-project#5409, opensearch-project#5400, opensearch-project#5406 (smaller carryovers + bumps)
Conflict resolutions (10 from main side, 3 from feature side):
api/spec/* (LanguageSpec, UnifiedFunctionSpec, UnifiedPplSpec,
UnifiedSqlSpec): took main. Main is a strict superset — adds
postAnalysisRules and preCompilationRules extension points, the new
FunctionSpecBuilder DSL, SCALAR category for length/regexp_replace/
date_trunc, the DatetimeExtension on PPL spec, and the CoreExtension
wiring on SQL spec. PR's RELEVANCE category is preserved unchanged.
api/UnifiedQueryPlanner.java, api/compiler/UnifiedQueryCompiler.java:
took main. Both adopt the new postAnalysisRules / preCompilationRules
hooks introduced in opensearch-project#5408 / opensearch-project#5419.
core/executor/QueryService.java: composed both sides — kept HEAD's
CalciteClassLoaderHelper.withCalciteClassLoader wrapper around main's
StageErrorHandler stage tracking. Same pattern as the original PR
resolution; both improvements are orthogonal.
legacy/plugin/RestSqlAction.java: took HEAD. The 3-way merge produced
a duplicated handleException/getRawErrorCode block; HEAD already
contained both the delegateToV2Engine refactor and the ErrorReport
unwrap from main, so HEAD is the correct superset.
integ-test/build.gradle: took feature. Both sides added the same
@ignore exclusion block; feature has alphabetical ordering and a more
detailed comment explaining the Gradle 9.4.1 TestEventReporterAsListener
cast bug.
integ-test/.../CalciteEvalCommandIT.java: composed both sides. Took
feature's helper-managed test_eval provisioning (createIndexByRestClient
+ isIndexExist guard, from opensearch-project#5407) so analytics-engine compatibility runs
get a parquet-backed index. Added back PR HEAD's test_eval_agent setup
(needed by the dotted-path eval tests for opensearch-project#5351) wrapped in its own
isIndexExist guard for the same parquet-aware idempotency.
plugin/.../TransportPPLQueryAction.java: took feature. PR opensearch-project#5403 made
analytics-engine an optional dependency by moving QueryPlanExecutor
from a required constructor parameter to an @Inject(optional=true)
setter. Feature's design supersedes our prior wiring.
plugin/.../SQLPlugin.java: took feature. The same opensearch-project#5403 simplification
removed loadExtensions/EngineExtensionsHolder/executionEngineExtensions
plumbing (no longer needed once analytics-engine is optionally bound).
Feature retains the createSqlAnalyticsRouter method this PR introduced.
plugin/.../config/EngineExtensionsHolder.java: deleted. Unreferenced
after taking feature's SQLPlugin/TransportPPLQueryAction; not present
on feature branch.
Build: :api, :core, :opensearch-sql-plugin, :legacy compileJava +
:integ-test compileTestJava all pass; unit tests pass; spotlessCheck
clean.
Signed-off-by: Kai Huang <ahkcs@amazon.com>
Description
The analytics-engine route and the v2 / Lucene path return columns in different orders when there is no explicit
| fields …clause:_sourceiteration orderBoth are valid given the contract
verifySchemadeclares (set equality on column names), so positionalverifyDataRowsassertions over-constrain the test and fail under-Dtests.analytics.force_routing=trueeven when the data is semantically correct.This change applies the same column-name-keyed match pattern @ahkcs introduced for
CalcitePPLRenameITin 59c728b (#5413), now toCalciteReplaceCommandIT.Changes
rowOf(key1, val1, …)— private helper to build column-keyed expected rows preserving insertion order viaLinkedHashMap.verifyDataRowsByColumn(…)— looks up each cell value by column name and reorders the expected row to match the response schema before delegating to the existing positionalverifyDataRowsmatcher.testMultipleReplacetestEmptyStringReplacementtestMultipleFieldsInClausetestMultiplePairsInSingleCommandtestReplaceNonExistentFieldorder-agnostic on theinput fields are: [...]field list — assert that the prefix and every expected field name appear in the message, but not in a fixed order.Test results
Against the analytics-engine route with
-Dtests.analytics.{force_routing,parquet_indices}=true:CalciteReplaceCommandITCalciteNoPushdownIT > CalciteReplaceCommandITThe v2 path remains green.
Related Issues
replacecommand +replace()/regexp_replace()functions on the analytics-engine route via DataFusion'sreplace/regexp_replaceUDFs (Calcite-side wiring + Java-regex→Rust-regexRegexpReplaceAdapter). This SQL PR is the test-side companion: without it the core PR'sCalciteReplaceCommandITvalidation hits the column-order false-positive failures described above.rowOf+verifyDataRowsByColumnhelper shape applied toCalcitePPLRenameIT.Check List