You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "xitep (via GitHub)" <gi...@apache.org> on 2026/02/23 14:15:40 UTC
[PR] Introduce `Visit::visit_select` [datafusion-sqlparser-rs]
xitep opened a new pull request, #2235:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2235
* `SetExpr` is a directly recursive data-structure through `SetExpr::SetOperation`
* Its visit impl dispatches directly to `Select` (without necessary going through `Query` first)
* Right now a `Visitor` impl has no chance to observe the scope of a visited SELECT
The motivation is that `SELECT`s often introduce aliases which are valid only for that particular SELECT.
```sql
select *
from (select 1 val from dual) x
where x.val = 1
union all
select *
from (select 2 val from dual) y
where y.val = 2
-- referring to `x` at this point is an error
```
This change allows effectively to determine the scope of a (nested) SELECT using `Visitor/Mut`.
Alternatively we could entirely drop `SetExpr::Select` and replace it's use with `SetExpr::Query`; after all a `Select` is a Query's body. (My personal preference would be to keep the current structure as it makes the AST easier to follow / navigate / more expressive.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] Introduce `Visit::visit_select` [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio merged PR #2235:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2235
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org