Repository navigation
Commit 3e6ad0f
committed
[fix](fe) Resolve correlated qualified columns before dereference
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: In a correlated subquery, a multipart reference could be interpreted as a nested field of an inner column before checking whether its first part was an outer table alias. This caused scalar inner columns to raise a no-such-field error and complex inner columns to bind silently to the wrong expression. Resolve relation-qualified columns across the current and outer scopes before falling back to column-field dereference.
### Release note
Fix incorrect Nereids column binding when an outer table alias conflicts with an inner column name in a correlated subquery.
### Check List (For Author)
- Test: Unit Test
- ./run-fe-ut.sh --run org.apache.doris.nereids.rules.analysis.TestDereference
- Added query_p0 regression coverage for scalar and complex inner columns
- Behavior changed: Yes (relation-qualified correlated references now take priority over inner column-field dereference)
- Does this need documentation: No1 parent 0494105 commit 3e6ad0f
3 files changed
Lines changed: 158 additions & 9 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/nereids/rules/analysis
- test/java/org/apache/doris/nereids/rules/analysis
- regression-test/suites/query_p0
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
313 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
314 | 331 | | |
315 | | - | |
316 | | - | |
| 332 | + | |
| 333 | + | |
317 | 334 | | |
318 | 335 | | |
319 | | - | |
320 | 336 | | |
321 | 337 | | |
322 | 338 | | |
| |||
1192 | 1208 | | |
1193 | 1209 | | |
1194 | 1210 | | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
1195 | 1230 | | |
1196 | 1231 | | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
1197 | 1238 | | |
1198 | 1239 | | |
1199 | 1240 | | |
1200 | | - | |
| 1241 | + | |
1201 | 1242 | | |
1202 | 1243 | | |
1203 | 1244 | | |
| |||
1216 | 1257 | | |
1217 | 1258 | | |
1218 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
1219 | 1266 | | |
1220 | 1267 | | |
1221 | | - | |
| 1268 | + | |
1222 | 1269 | | |
1223 | 1270 | | |
1224 | 1271 | | |
| |||
1237 | 1284 | | |
1238 | 1285 | | |
1239 | 1286 | | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1240 | 1293 | | |
1241 | 1294 | | |
1242 | | - | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1243 | 1298 | | |
1244 | 1299 | | |
1245 | 1300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
42 | 58 | | |
43 | 59 | | |
44 | 60 | | |
| |||
70 | 86 | | |
71 | 87 | | |
72 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
73 | 110 | | |
74 | 111 | | |
75 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 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 | + | |
0 commit comments