Commit d08a6ea
committed
refactor(esql): Improve MvExpand push-down logic in logical optimizer
- Enhance PushDownMvExpandPastProject rule to handle more complex query scenarios
- Add checks to prevent duplicate output attributes when pushing down MvExpand
- Support pushing down MvExpand for queries with aliased expressions
- Handle cases where target is an alias or referenced in an alias
- Add test case to verify complex MvExpand push-down behavior
Resolves edge cases in multi-stage query optimization where MvExpand interactions with Project and Eval nodes were previously limited.1 parent 471124c commit d08a6ea
File tree
2 files changed
+46
-16
lines changed- x-pack/plugin/esql/src
- main/java/org/elasticsearch/xpack/esql/optimizer/rules/logical
- test/java/org/elasticsearch/xpack/esql/optimizer
2 files changed
+46
-16
lines changedLines changed: 38 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
27 | 41 | | |
28 | 42 | | |
29 | 43 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
40 | 68 | | |
41 | 69 | | |
42 | 70 | | |
| |||
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3149 | 3149 | | |
3150 | 3150 | | |
3151 | 3151 | | |
3152 | | - | |
3153 | | - | |
| 3152 | + | |
| 3153 | + | |
3154 | 3154 | | |
3155 | 3155 | | |
3156 | | - | |
3157 | | - | |
3158 | | - | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
3159 | 3160 | | |
3160 | 3161 | | |
3161 | 3162 | | |
| |||
3171 | 3172 | | |
3172 | 3173 | | |
3173 | 3174 | | |
3174 | | - | |
| 3175 | + | |
| 3176 | + | |
3175 | 3177 | | |
3176 | 3178 | | |
3177 | 3179 | | |
| |||
0 commit comments