Skip to content

Conversation

@mjgarton
Copy link
Contributor

@mjgarton mjgarton commented Oct 9, 2025

Add initial extended query support in QueryHook, and some minor refactoring to support this. See individual commits for more detail.

When we parse the sql, retain the parsed statement as well as the raw
string and the plan.  This is because we have upcoming cases where we
want to reference the statement without needing to re-parse the query.
Add extended query support to QueryHook,.

Also re-use the parsed statement instead of parsing it again because it
is was wasted work, and it also made the code less clean.

(We still potentially handle the params more than once, which can be
fixed later)

Finally, ensure the client is Send + Sync. (Should this be enforced in
pgwire?)
@mjgarton
Copy link
Contributor Author

mjgarton commented Oct 9, 2025

Use of sqlparser::ast::Statement here means I need to add a dependency on sqlparser in my project that uses this. Should we re-export this for simplicity?

@sunng87
Copy link
Member

sunng87 commented Oct 9, 2025

@mjgarton hey Martin, sqlparser is already reported from datafusion at datafusion::sql::sqlparser

Add handle_extended_parse_query to QueryHook so that parse phase
operations can be processed.
@sunng87 sunng87 merged commit fd20234 into datafusion-contrib:master Oct 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants