Commit e8a0829
Allow Logical expression ScalarVariable to represent an extension type or metadata (apache#18243)
## Which issue does this PR close?
- Closes apache#18230
## Rationale for this change
Add richer variable metadata by switching Expr::ScalarVariable to store
an Arrow Field, allowing planners to retain nullability and metadata
when handling @var expressions.
## What changes are included in this PR?
This PR updates ScalarVariable to use FieldRef so it can represent
extension types and metadata in logical expressions.
## Are these changes tested?
Yes
## Are there any user-facing changes?
When planning queries with variables (e.g., @foo), the resulting logical
expressions carry full field metadata instead of only a data type. This
can affect downstream components that inspect nullability or custom
metadata.
---------
Co-authored-by: Dewey Dunnington <dewey@dunnington.ca>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>1 parent d85595e commit e8a0829
File tree
5 files changed
+60
-22
lines changed- datafusion
- expr/src
- sql/src
- expr
- unparser
5 files changed
+60
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
2529 | 2529 | | |
2530 | 2530 | | |
2531 | 2531 | | |
2532 | | - | |
2533 | | - | |
| 2532 | + | |
| 2533 | + | |
2534 | 2534 | | |
2535 | 2535 | | |
2536 | 2536 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
| 368 | + | |
| 369 | + | |
374 | 370 | | |
375 | 371 | | |
376 | 372 | | |
| |||
503 | 499 | | |
504 | 500 | | |
505 | 501 | | |
506 | | - | |
507 | | - | |
508 | | - | |
| 502 | + | |
509 | 503 | | |
510 | 504 | | |
511 | 505 | | |
| |||
1206 | 1200 | | |
1207 | 1201 | | |
1208 | 1202 | | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1209 | 1220 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
48 | | - | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | | - | |
| 120 | + | |
115 | 121 | | |
116 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
117 | 128 | | |
118 | 129 | | |
119 | 130 | | |
120 | | - | |
| 131 | + | |
121 | 132 | | |
122 | 133 | | |
123 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
| 1786 | + | |
1786 | 1787 | | |
1787 | 1788 | | |
1788 | 1789 | | |
| |||
2169 | 2170 | | |
2170 | 2171 | | |
2171 | 2172 | | |
2172 | | - | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
2173 | 2177 | | |
2174 | 2178 | | |
2175 | 2179 | | |
2176 | 2180 | | |
2177 | | - | |
| 2181 | + | |
2178 | 2182 | | |
2179 | 2183 | | |
2180 | 2184 | | |
| |||
0 commit comments