Skip to content

Enhance Snowflake SQL parser support#6600

Open
wenshao wants to merge 2 commits intomasterfrom
snowflake
Open

Enhance Snowflake SQL parser support#6600
wenshao wants to merge 2 commits intomasterfrom
snowflake

Conversation

@wenshao
Copy link
Copy Markdown
Member

@wenshao wenshao commented Feb 12, 2026

  • Add Snowflake specific keywords in SnowflakeLexer (CLONE, STAGE, PIPE, STREAM, TASK, WAREHOUSE, UNDROP, QUALIFY, etc.)
  • Add SnowflakeSelectParser with QUALIFY clause and LIMIT/OFFSET support
  • Enhance SnowflakeExprParser with Snowflake aggregate functions and LIMIT syntax
  • Enhance SnowflakeStatementParser with CREATE TABLE CLONE, CREATE OR REPLACE VIEW, TEMPORARY TABLE support
  • Add new tokens and FnvHash constants for Snowflake
  • Add test cases for Snowflake SQL parsing

wenshao and others added 2 commits February 12, 2026 13:11
- Add Snowflake specific keywords in SnowflakeLexer (CLONE, STAGE, PIPE, STREAM, TASK, WAREHOUSE, UNDROP, QUALIFY, etc.)
- Add SnowflakeSelectParser with QUALIFY clause and LIMIT/OFFSET support
- Enhance SnowflakeExprParser with Snowflake aggregate functions and LIMIT syntax
- Enhance SnowflakeStatementParser with CREATE TABLE CLONE, CREATE OR REPLACE VIEW, TEMPORARY TABLE support
- Add new tokens and FnvHash constants for Snowflake
- Add test cases for Snowflake SQL parsing

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Test coverage includes:
- DDL: CREATE TABLE (simple, CLONE, TEMPORARY, IF NOT EXISTS, OR REPLACE, NOT NULL)
- DDL: CREATE VIEW (simple, OR REPLACE, IF NOT EXISTS)
- DML: INSERT, UPDATE, DELETE, TRUNCATE TABLE
- DML: MERGE INTO with UPDATE, INSERT, DELETE clauses
- SELECT: QUALIFY clause with ROW_NUMBER, RANK, DENSE_RANK
- SELECT: LIMIT/OFFSET, DISTINCT, ALL
- SELECT: CTE (WITH clause), subqueries
- SELECT: JOIN (INNER, LEFT, RIGHT, FULL, CROSS)
- SELECT: GROUP BY with HAVING, ORDER BY, ROLLUP, CUBE
- SELECT: Window functions (ROW_NUMBER, RANK, LAG)
- SET operations: UNION, UNION ALL, INTERSECT, MINUS, EXCEPT
- Semi-structured data: array access, PARSE_JSON, ARRAY_CONSTRUCT, OBJECT_CONSTRUCT

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
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.

1 participant