Repository navigation
Conversation
separate the KQL parser, tokenizer, lexer from the SQL parser
Contributor
|
This is an automated comment for commit 6b905ba 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
|
Contributor
|
Dear @yakov-olkhovskiy, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Contributor
|
Dear @yakov-olkhovskiy, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Contributor
Member
|
The implementation here wasn't as intended. Instead of implementing a separate Lexer and Parser, it copy-pasted most of the code, so it would be difficult to maintain. |
pull Bot
pushed a commit
to Mu-L/ClickHouse
that referenced
this pull request
Aug 29, 2026
The dialect was contributed in 2022 and abandoned by its authors; the rewrite they promised in ClickHouse#62668 was closed unmerged. Since then it has been emergency-disabled once (ClickHouse#59305) and gated behind `allow_experimental_kusto_dialect` (ClickHouse#74224), and issue ClickHouse#61742 ("Remove KQL support if this code will not be fixed") has stayed open. The implementation translated a KQL token stream directly into ClickHouse SQL *text* and re-parsed it. Everything below follows from that: - KQL string literals were spliced into generated SQL unescaped, so `T | where s contains "x') OR 1 = 1 OR ilike(s, 'y"` injected arbitrary expressions -- and `contains '50%'` matched `'50x'` because LIKE metacharacters passed through. - No types were available while translating, so 14 sites emitted runtime `toTypeName()` dispatch and datetimes were modelled as strings truncated to 27 characters. - Arguments were SQL text, so a dozen sites called `std::stoi` on it; `format_timespan(col, 'hh:mm')` failed with "stoi: no conversion". - 28 of the 237 registered functions were stubs that returned the raw KQL name into the generated SQL, including every `series_*`. - `let` bindings lived in a `static thread_local` map that, by its own comment, leaked between unrelated queries. This commit removes the implementation and every trace of it: the parser, the `kusto` dialect and its experimental setting, the `kusto` value of `interval_output_format` and the interval serialization it drove, the client/server call sites, the fuzzer and style-check carve-outs, and the tests. A correct implementation is added next. Two notes on what was deliberately kept. `ASTSelectQuery::normalize ChildrenOrder` stays -- several other parsers use it -- with its comment generalized. `04305_parser_error_message_oob_101143.sh` stays as a regression test for the error-formatter buffer overflow; its rationale is rewritten, since the parser it originally exercised is now gone. Release history in CHANGELOG.md, docs/changelogs/ and SettingsChangesHistory.cpp is left untouched.
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):
Separate the KQL parser from the SQL parser by using a dedicated parser, tokenizer, lexer for KQL, This will prevent interference between SQL and KQL