You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make CalciteReplaceCommandIT column-order-agnostic for analytics-engine route
The analytics-engine route and the v2 / Lucene path return columns in different
orders when there is no explicit `| fields ...` clause: parquet preserves the
storage order chosen by the on-disk format, while the Lucene path preserves
`_source` iteration order. Both are valid given the contract `verifySchema`
declares (set equality on column names), so positional `verifyDataRows`
assertions over-constrain the test and fail under
`-Dtests.analytics.force_routing=true` even when the data is correct.
Apply the same column-name-keyed match pattern Kai introduced for
`CalcitePPLRenameIT` in 59c728b (opensearch-project#5413):
* Add `rowOf(key1, val1, ...)` to build column-keyed expected rows.
* Add `verifyDataRowsByColumn(...)` to look up each cell value by column
name and reorder to match the response schema before delegating to the
existing positional `verifyDataRows` matcher.
* Convert the four order-sensitive tests
(`testMultipleReplace`, `testEmptyStringReplacement`,
`testMultipleFieldsInClause`, `testMultiplePairsInSingleCommand`) to
the new helpers.
* Make `testReplaceNonExistentField` order-agnostic on the
`input 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 analytics-engine route via
`-Dtests.analytics.{force_routing,parquet_indices}=true`: 21/21 pass in both
the direct `CalciteReplaceCommandIT` suite and the `CalciteNoPushdownIT >
CalciteReplaceCommandIT` re-run. v2 path remains green.
Companion to the OpenSearch PR onboarding PPL `replace` command +
`replace()` / `regexp_replace()` functions on the analytics-engine route
via DataFusion `replace` / `regexp_replace` UDFs.
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
0 commit comments