SQL: Parse queries immediately for non-JDBC endpoints.#18102
Merged
gianm merged 2 commits intoapache:masterfrom Jun 10, 2025
Merged
SQL: Parse queries immediately for non-JDBC endpoints.#18102gianm merged 2 commits intoapache:masterfrom
gianm merged 2 commits intoapache:masterfrom
Conversation
SET statements (apache#17894) provide a new way to set query context. However, they are not available early enough to inform important operations like engine selection and planner rule construction. This patch moves parsing as early as possible: immediately on receiving the query from the user. As a consequence of moving parsing prior to statement creation, with this change, SQL queries that cannot be parsed are no longer logged.
clintropolis
approved these changes
Jun 10, 2025
Member
clintropolis
left a comment
There was a problem hiding this comment.
nice 👍
freshCopy feels kind of weird, but I can't really think of a cleaner way to do it, and making a factory thing or whatever seems like overkill, so 🤷
Contributor
Author
It is kind of weird, but that's what you get when you have mutable data structures. Btw, I did look for a way to do a deep clone of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SET statements (#17894) provide a new way to set query context. However, they are not available early enough to inform important operations like engine selection and planner rule construction. This patch moves parsing as early as possible: immediately on receiving the query from the user.
Behavior change: as a consequence of moving parsing prior to statement creation, SQL queries that cannot be parsed are no longer logged, nor do they have metrics emitted.