Commit d41992f
authored
Analytics engine - add support for index patterns, aliases, multi-index search (opensearch-project#21822)
* analytics: add alias, index pattern, and multi-index query support
Enables queries against aliases, wildcard patterns, and comma-separated index
expressions. The planner resolves these to concrete indices, validates schema
compatibility, and builds a union row type. At the data node, Rust widens the
registered ListingTable schema from the plan's base_schema so DataFusion
null-fills columns this shard doesn't have.
Key components:
- IndexResolution: expands aliases/patterns to concrete indices, validates
field type compatibility, rejects filter aliases and data streams
- FieldStorageResolver.merged(): unions per-field storage across backing indices
- ShardTargetResolver: fans out shard routing across all concrete indices
- widen_schema_from_plan (Rust): appends missing nullable columns to the
ListingTable using from_substrait_named_struct for type conversion
- UnifiedQueryService: preserves lazy table resolution for wildcard support
- Indexed execution (filter delegation): now passes plan bytes to Rust,
enabling multi-index support on the delegation path
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
* spotless
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
* Add missing tests from PR review feedback
- Case-insensitive table resolution test (OpenSearchSchemaBuilderTests)
- findTableName on join/union shapes (RelNodeUtilsTests) + generalize
findTableName to match any TableScan, not just OpenSearchTableScan
- Field-conflict test for comma-separated sources (first-wins semantics)
- IndexResolution: concrete name with resolver, exclusion pattern test
- Rust: empty/garbage input tests for first_named_table_name
- Rust: widen_schema_from_plan noop tests (empty plan, all cols present)
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
* Fix schema builder to be lazy.
Add more tests
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
* Add support for datastreams
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
* add more datastream edge cases
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
* fix sql tests
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
* remove unintentional run.gradle update
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
---------
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>1 parent ba9befb commit d41992f
50 files changed
Lines changed: 3179 additions & 142 deletions
File tree
- sandbox
- libs/analytics-api/src/main/java/org/opensearch/analytics/schema
- plugins
- analytics-backend-datafusion
- rust/src
- src
- main/java/org/opensearch/be/datafusion
- nativelib
- test/java/org/opensearch/be/datafusion
- analytics-backend-lucene/src/test/java/org/opensearch/be/lucene
- analytics-engine/src
- main/java/org/opensearch/analytics
- exec
- stage
- planner
- dag
- rules
- test/java/org/opensearch/analytics
- engine
- exec
- action
- planner
- dag
- test-ppl-frontend/src/main/java/org/opensearch/ppl/action
- qa
- analytics-engine-coordinator/src/internalClusterTest/java/org/opensearch/analytics/sql
- analytics-engine-rest/src/test/java/org/opensearch/analytics/qa
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 114 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
| 23 | + | |
19 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
20 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
26 | 38 | | |
27 | 39 | | |
28 | | - | |
29 | 40 | | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
34 | 49 | | |
35 | 50 | | |
36 | | - | |
37 | 51 | | |
38 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
39 | 63 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
43 | 86 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
48 | 146 | | |
49 | 147 | | |
50 | 148 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 149 | + | |
56 | 150 | | |
57 | 151 | | |
58 | 152 | | |
59 | | - | |
60 | | - | |
| 153 | + | |
61 | 154 | | |
62 | | - | |
63 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
64 | 159 | | |
65 | 160 | | |
66 | 161 | | |
| |||
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
990 | 1024 | | |
991 | 1025 | | |
992 | 1026 | | |
| |||
1373 | 1407 | | |
1374 | 1408 | | |
1375 | 1409 | | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
1376 | 1420 | | |
1377 | 1421 | | |
1378 | 1422 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| 652 | + | |
| 653 | + | |
652 | 654 | | |
653 | 655 | | |
654 | 656 | | |
655 | 657 | | |
656 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
657 | 664 | | |
658 | 665 | | |
659 | 666 | | |
| |||
663 | 670 | | |
664 | 671 | | |
665 | 672 | | |
| 673 | + | |
666 | 674 | | |
667 | 675 | | |
668 | 676 | | |
| |||
679 | 687 | | |
680 | 688 | | |
681 | 689 | | |
| 690 | + | |
| 691 | + | |
682 | 692 | | |
683 | 693 | | |
684 | 694 | | |
685 | 695 | | |
686 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
687 | 702 | | |
688 | 703 | | |
689 | 704 | | |
690 | 705 | | |
691 | | - | |
| 706 | + | |
692 | 707 | | |
693 | 708 | | |
694 | 709 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| |||
Lines changed: 58 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
160 | 184 | | |
161 | 185 | | |
162 | 186 | | |
163 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
164 | 222 | | |
165 | 223 | | |
166 | 224 | | |
| |||
0 commit comments