Commit 9321138
fix: Snowflake LATERAL FLATTEN handles SubqueryAlias between Unnest and Projection
When a table is accessed through a passthrough/virtual table mapping,
DataFusion inserts a SubqueryAlias node between Unnest and its inner
Projection. The FLATTEN rendering code assumed a direct Projection child
and failed with "Unnest input is not a Projection: SubqueryAlias(...)".
Peel through SubqueryAlias in three code paths that inspect unnest.input:
try_unnest_to_lateral_flatten_sql, the inline-vs-table source check, and
the general unnest recursion. Also fix a pre-existing collapsible_if
clippy warning in check_unnest_placeholder_with_outer_ref.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e701962 commit 9321138
2 files changed
Lines changed: 62 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
445 | 453 | | |
446 | 454 | | |
447 | 455 | | |
| |||
1186 | 1194 | | |
1187 | 1195 | | |
1188 | 1196 | | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1189 | 1202 | | |
1190 | 1203 | | |
1191 | 1204 | | |
| |||
1250 | 1263 | | |
1251 | 1264 | | |
1252 | 1265 | | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1259 | 1271 | | |
| 1272 | + | |
1260 | 1273 | | |
1261 | 1274 | | |
1262 | 1275 | | |
| |||
1306 | 1319 | | |
1307 | 1320 | | |
1308 | 1321 | | |
1309 | | - | |
1310 | | - | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
1311 | 1332 | | |
1312 | 1333 | | |
1313 | 1334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3183 | 3183 | | |
3184 | 3184 | | |
3185 | 3185 | | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
0 commit comments