Clickhouse SQL parsing fixes#7122
Open
jwhitaker-gridcog wants to merge 6 commits intotobymao:mainfrom
Open
Conversation
Add support for ClickHouse's `.^` operator for accessing nested JSON subcolumns. Introduces a new `DOTCARET` token type, `NestedSelect` expression, and corresponding parser/generator support in the ClickHouse dialect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arams) Parse and generate ClickHouse JSON type arguments including column type hints (col String), SKIP paths (SKIP col), and config parameters (max_dynamic_paths=2). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add parsing and generation for ClickHouse SQL SECURITY syntax on CREATE VIEW, CREATE MATERIALIZED VIEW, and ALTER TABLE MODIFY: - SQL SECURITY DEFINER | INVOKER | NONE - DEFINER = 'user' | CURRENT_USER - ALTER TABLE v MODIFY SQL SECURITY ... DEFINER = ... New AlterModifySqlSecurity expression class handles the ALTER TABLE MODIFY action. DefinerProperty and SqlSecurityProperty are placed at POST_SCHEMA location (after view name) in ClickHouse, overriding the default POST_CREATE location. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…al post-claude fixes)
329430a to
2c88f85
Compare
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.
This PR contains three Clickhouse SQL parsing fixes
.^JSON parsing operator, e.g.select json_col.^keyJSON()type, e.g.select val::JSON(col1 String, SKIP col2)_parse_typedialect implementations have any custom parsing logic in them - should this have gone in base expressions anyway?sql securityon views and mat views.For each of these I wrote a test by hand and got Claude Code to implement it, then did any post-AI fixes in a separate commit. Claude is honestly probably more reliable than me at this; I've contributed a couple of small things to sqlglot before but I'm nowhere near fluent in your parser design.
Thanks for maintaining this!