Commit 9eddf47
authored
fix: CteWorkTable: properly apply TableProvider::scan projection argument (#18993)
It was previously ignored
## Which issue does this PR close?
- Closes #18992.
## Rationale for this change
All `TableProvider` implementations must support the `projection`
argument of the `scan` method. This was not the case in `CteWorkTable`.
## What changes are included in this PR?
Minimal implementation of the projection support. The projection applied
before the plan node return results. It might be nice to push it further
inside of the recursion implementation to reduce memory consumption but
I preferred to keep the fix minimal.
## Are these changes tested?
I have not figured out yet a nice SQL query to trigger an error without
this change. Some existing queries in `cte.slt` have set projection
(i.e. not `None`) so the code is very likely working. There is also a
test on the projection itself in `WorkTableExec`1 parent 6ac7b89 commit 9eddf47
File tree
2 files changed
+106
-23
lines changed- datafusion
- catalog/src
- physical-plan/src
2 files changed
+106
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | | - | |
22 | 23 | | |
23 | | - | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 26 | | |
31 | 27 | | |
| 28 | + | |
| 29 | + | |
32 | 30 | | |
33 | | - | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
92 | 90 | | |
93 | | - | |
94 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
95 | 104 | | |
96 | 105 | | |
97 | | - | |
| 106 | + | |
| 107 | + | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
116 | 125 | | |
117 | | - | |
| 126 | + | |
118 | 127 | | |
119 | 128 | | |
120 | | - | |
| 129 | + | |
121 | 130 | | |
| 131 | + | |
122 | 132 | | |
123 | | - | |
| 133 | + | |
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
| |||
198 | 208 | | |
199 | 209 | | |
200 | 210 | | |
201 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
202 | 224 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 225 | + | |
| 226 | + | |
206 | 227 | | |
207 | 228 | | |
208 | 229 | | |
| |||
239 | 260 | | |
240 | 261 | | |
241 | 262 | | |
| 263 | + | |
242 | 264 | | |
243 | 265 | | |
244 | 266 | | |
| |||
249 | 271 | | |
250 | 272 | | |
251 | 273 | | |
252 | | - | |
| 274 | + | |
| 275 | + | |
253 | 276 | | |
| 277 | + | |
254 | 278 | | |
255 | 279 | | |
256 | 280 | | |
| |||
283 | 307 | | |
284 | 308 | | |
285 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
286 | 359 | | |
0 commit comments