Commit acd9215
authored
MQE: shift responsibilities of
#### What this PR does
This PR changes the responsibilities of MQE's `Materializer` type.
Previously, `Materializer.ConvertNodeToOperator` would materialize all
of the given node's children and pass it to `Node.OperatorFactory`, and
`OperatorFactory` would have no access to the `Materializer`. With the
existing set of query plan nodes, this was not an issue, but it is
problematic for some scenarios, for example:
* for remote execution, there's no point materializing operators for the
parts of the query plan that will be executed remotely
* for caching and splitting, there's also no point materializing
operators for cached results, but we'll then need to materialize the
child operator if there is a cache miss, or only materialize the child
operator for a subset of the time range
This PR also moves `Materializer` to the `planning` package to prevent
an import cycle (and seems like a more natural fit for there anyway).
Depending on which PR merges first, either this PR or
#12302 will need changes to account
for the changes in the other.
This PR has no user-visible impact and so I've chosen not to add a
changelog entry.
#### Which issue(s) this PR fixes or relates to
(none)
#### Checklist
- [n/a] Tests updated.
- [n/a] Documentation added.
- [n/a] `CHANGELOG.md` updated - the order of entries should be
`[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If changelog entry
is not needed, please add the `changelog-not-needed` label to the PR.
- [n/a]
[`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md)
updated with experimental features.Materializer (#12377)1 parent 540f431 commit acd9215
File tree
15 files changed
+160
-144
lines changed- pkg/streamingpromql
- optimize/plan/commonsubexpressionelimination
- planning
- core
15 files changed
+160
-144
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
This file was deleted.
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
Lines changed: 13 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
111 | 107 | | |
112 | 108 | | |
113 | 109 | | |
114 | 110 | | |
115 | 111 | | |
116 | 112 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
124 | 116 | | |
125 | 117 | | |
126 | 118 | | |
127 | 119 | | |
128 | 120 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
136 | 124 | | |
137 | 125 | | |
138 | | - | |
139 | 126 | | |
140 | 127 | | |
141 | 128 | | |
142 | 129 | | |
143 | 130 | | |
144 | 131 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
152 | 135 | | |
153 | 136 | | |
154 | 137 | | |
155 | 138 | | |
156 | 139 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 140 | | |
162 | 141 | | |
163 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
135 | 129 | | |
136 | 130 | | |
137 | | - | |
138 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
139 | 134 | | |
140 | 135 | | |
141 | 136 | | |
| |||
177 | 172 | | |
178 | 173 | | |
179 | 174 | | |
180 | | - | |
181 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 51 | | |
57 | 52 | | |
58 | 53 | | |
| |||
67 | 62 | | |
68 | 63 | | |
69 | 64 | | |
70 | | - | |
71 | | - | |
72 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
73 | 68 | | |
74 | | - | |
75 | | - | |
| 69 | + | |
| 70 | + | |
76 | 71 | | |
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
80 | | - | |
81 | | - | |
| 75 | + | |
| 76 | + | |
82 | 77 | | |
83 | 78 | | |
84 | 79 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 80 | + | |
| 81 | + | |
88 | 82 | | |
89 | 83 | | |
90 | 84 | | |
| |||
124 | 118 | | |
125 | 119 | | |
126 | 120 | | |
127 | | - | |
128 | | - | |
129 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
130 | 126 | | |
131 | 127 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 128 | + | |
137 | 129 | | |
138 | 130 | | |
139 | 131 | | |
| |||
0 commit comments