You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "sabir-akhadov-localstack (via GitHub)" <gi...@apache.org> on 2026/06/08 14:34:45 UTC

[PR] Add pre_visit_ident / post_visit_ident hooks to the Visitor trait [datafusion-sqlparser-rs]

sabir-akhadov-localstack opened a new pull request, #2370:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2370

   The `Visitor` / `VisitorMut` traits had no hook for individual identifiers:
   `Ident` derived a no-op `Visit`, so identifiers could not be observed or
   rewritten during a traversal. This makes it impossible to, e.g., collect every
   identifier in a statement or rewrite identifiers in place.
   
   This adds `pre_visit_ident` / `post_visit_ident` (default no-op) to both
   `Visitor` and `VisitorMut`, and gives `Ident` a manual `Visit` / `VisitMut`
   impl that invokes them.
   
   Example — collect identifiers:
   
       struct IdentVisitor { idents: Vec<String> }
       impl Visitor for IdentVisitor {
           type Break = ();
           fn pre_visit_ident(&mut self, ident: &Ident) -> ControlFlow<()> {
               self.idents.push(ident.value.clone());
               ControlFlow::Continue(())
           }
       }
       // "SELECT a, b FROM t" -> ["a", "b", "t"]
   
   Tests added in `src/ast/visitor.rs` for both the immutable and mutable hooks.
   


-- 
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] Add pre_visit_ident / post_visit_ident hooks to the Visitor trait [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio merged PR #2370:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2370


-- 
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] Add pre_visit_ident / post_visit_ident hooks to the Visitor trait [datafusion-sqlparser-rs]

Posted by "sabir-akhadov-localstack (via GitHub)" <gi...@apache.org>.
sabir-akhadov-localstack commented on PR #2370:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2370#issuecomment-4678823928

   Let me know if I can make this easier to review.
   
   I have a medium sized stack of commits for Snowflake dialect improvements ready to go after this one but I don't want to overwhelm the pipeline.


-- 
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] Add pre_visit_ident / post_visit_ident hooks to the Visitor trait [datafusion-sqlparser-rs]

Posted by "sabir-akhadov-localstack (via GitHub)" <gi...@apache.org>.
sabir-akhadov-localstack commented on PR #2370:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2370#issuecomment-4710088686

   Hi @iffyio — would you mind kicking off the CI workflow on this PR?
   It looks like it's waiting on maintainer approval to run (first-time contributor), so there are no check results yet.
   Happy to address any feedback once it's green.
   
   For context, I am working on a local Snowflake emulator in Rust and will be extending the Snowflake dialect extensively.


-- 
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