Fix unexpected behavior with FORMAT and SETTINGS parsing#60197
Merged
alexey-milovidov merged 52 commits intomasterfrom Aug 19, 2024
Merged
Fix unexpected behavior with FORMAT and SETTINGS parsing#60197alexey-milovidov merged 52 commits intomasterfrom
FORMAT and SETTINGS parsing#60197alexey-milovidov merged 52 commits intomasterfrom
Conversation
Contributor
|
This is an automated comment for commit 20ebbc3 with description of existing statuses. It's updated for the latest CI running ✅ Click here to open a full report in a separate page Successful checks
|
pufit
approved these changes
Jun 29, 2024
| /** Set setting for current context (query context). | ||
| * It is used for interpretation of SETTINGS clause in SELECT query. | ||
| */ | ||
| void executeForCurrentContext(bool ignore_setting_constraints = false); |
Member
There was a problem hiding this comment.
Is it better without default? I think it's not clear what executeForCurrentContext(false) means without looking into the definition (or we can add comments executeForCurrentContext(/* ignore_setting_constraints = */ false)
| * This does not work automatically, unless we explicitly allow different orders: | ||
| * (SELECT 1) UNION ALL (SELECT 2) SETTINGS d=f FORMAT TSV | ||
| * Inevitably, we also allow this: | ||
| * SELECT 1 SETTINGS a=b SETTINGS d=f FORMAT TSV |
Member
There was a problem hiding this comment.
This looks funny, but I agree. I don't see an easy solution for this behavior unless we set a strict order in FORMAT ... SETTINGS
…-settings-parsing
…-settings-parsing
Member
Author
Member
Author
Member
Author
Member
Author
|
Needs #68462. |
…-settings-parsing
…-settings-parsing
This was referenced Aug 20, 2024
20 tasks
azat
added a commit
to azat/ClickHouse
that referenced
this pull request
Feb 21, 2025
Introduced in ClickHouse#38900, removed in ClickHouse#60197 (ClickHouse#68614)
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Allow to write
SETTINGSbeforeFORMATin a chain of queries withUNIONwhen subqueries are inside parentheses. This closes #39712. Change the behavior when a query has the SETTINGS clause specified twice in a sequence. The closest SETTINGS clause will have a preference for the corresponding subquery. In the previous versions, the outermost SETTINGS clause could take a preference over the inner one.