Commit 9f6aef8
committed
spath: Arrow Map response marshalling + parquet-backed test indices
Two complementary changes for closing PPL `spath` parity on the
analytics-engine route. Pairs with opensearch-project/OpenSearch#21664
(the analytics-engine `json_extract_all` UDF + ITEM-on-MAP dispatch +
MAP capability registrations). Both PRs together take
`CalcitePPLSpathCommandIT` on the analytics-engine route from 0 / 16
to 16 / 16 without regressing the v2 / Calcite path (still 16 / 16).
## Pass rate
| IT | Route | Before | After |
|---|---|---|---|
| `CalcitePPLSpathCommandIT` | analytics-engine (`-Dtests.analytics.force_routing=true -Dtests.analytics.parquet_indices=true`) | 0 / 16 | **16 / 16** |
| `CalcitePPLSpathCommandIT` | default v2 / Calcite (no flags) | 16 / 16 | 16 / 16 (no regression) |
The analytics-route number depends on this PR + #21664 landing together;
neither PR alone moves it off 0 / 16.
## Changes
1. **`core/.../ExprValueUtils.java`** — `fromObjectValue` gains a
FQN-keyed branch for `org.apache.arrow.vector.util.Text` (decoded
via `toString()`). Arrow's MapVector / StructVector emit values as
`Text` (a UTF-8 byte-buffer wrapper that does NOT implement
`CharSequence`), which none of the typed `instanceof` branches
recognized. Without this, any UDF returning `Map<Utf8, Utf8>`
through the analytics-engine route surfaces as
`ExpressionEvaluationException: unsupported object class
org.apache.arrow.vector.util.Text`. FQN match keeps `core/` free of
an Arrow dependency.
2. **`integ-test/.../CalcitePPLSpathCommandIT.java`** — refactor
`init()` to use `TestUtils.createIndexByRestClient` with an explicit
keyword mapping for each of the four test indices (`test_spath`,
`test_spath_auto`, `test_spath_cmd`, `test_spath_null`) before the
per-doc PUTs. Without an explicit createIndex, the dynamic-mapping
route bypasses the `tests.analytics.parquet_indices=true` parquet
injection (because the toggle only fires inside
`TestUtils.createIndexByRestClient`) and the analytics-engine
fragment driver then fails with `UnsupportedOperationException:
acquireReader is not supported in EngineBackedIndexer` for any test
that reaches the runtime — `testSimpleSpath` was the only test
affected before this PR (the other 15 failed earlier at the planner
capability check). Idempotency via `TestUtils.isIndexExist` so the
cluster-reuse pattern between `@Test` methods keeps working. No
change for the v2 / Calcite path (the helper is a no-op for
non-parquet runs).
Signed-off-by: Kai Huang <ahkcs@amazon.com>1 parent 1efb6c3 commit 9f6aef8
2 files changed
Lines changed: 91 additions & 32 deletions
File tree
- core/src/main/java/org/opensearch/sql/data/model
- integ-test/src/test/java/org/opensearch/sql/calcite/remote
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
| |||
143 | 154 | | |
144 | 155 | | |
145 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
146 | 169 | | |
147 | 170 | | |
148 | 171 | | |
| |||
Lines changed: 68 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
21 | 41 | | |
22 | 42 | | |
23 | 43 | | |
| |||
26 | 46 | | |
27 | 47 | | |
28 | 48 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
32 | 55 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
36 | 59 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
40 | 64 | | |
41 | 65 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
51 | 79 | | |
52 | 80 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 81 | + | |
| 82 | + | |
57 | 83 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
62 | 94 | | |
63 | 95 | | |
64 | | - | |
65 | | - | |
66 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
67 | 102 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
71 | 107 | | |
72 | 108 | | |
73 | 109 | | |
| |||
0 commit comments