Skip to content

Commit 866576a

Browse files
h3n4lclaude
andauthored
feat: add Apache Doris parser with official grammar (#43)
* docs: add design for separating StarRocks and Doris parsers Document the plan to rename existing doris/ to starrocks/ and create a new doris/ directory using the official Apache Doris grammar. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * docs: add implementation plan for StarRocks/Doris separation Detailed step-by-step plan covering: - Renaming existing doris/ to starrocks/ - Creating new doris/ with Apache Doris grammar - Adding test examples from Doris documentation - Updating CI workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * refactor: rename doris parser to starrocks The existing doris/ directory actually contains StarRocks SQL grammar. Rename to accurately reflect the parser source. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * feat: add Apache Doris parser with official grammar Add new doris/ directory using the official Apache Doris grammar from: https://github.com/apache/doris/tree/master/fe/fe-core/src/main/antlr4/org/apache/doris/nereids Modified grammar files to be compatible with ANTLR Go target: - Removed Java @members sections from DorisLexer.g4 and DorisParser.g4 - Removed Java predicates (isValidDecimal, isNoBackslashEscapes, ansiSQLSyntax) - Simplified lexer rules for STRING_LITERAL, DECIMAL_VALUE, EXPONENT_VALUE, and BIGDECIMAL_LITERAL - Made queryOrganization optional in querySpecification rule Includes test examples from Doris documentation for: - SELECT statements - INSERT statements - CREATE TABLE statements All tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * ci: add starrocks parser to test matrix * test(doris): add comprehensive SQL examples from Doris documentation Add 17 SQL test files covering all major statement categories: - Data Query: SELECT statements - DML: INSERT, INSERT OVERWRITE, UPDATE, DELETE - DDL: CREATE/ALTER/DROP TABLE, DATABASE, VIEW, INDEX - Account Management: CREATE USER - Transaction: BEGIN, COMMIT - Materialized Views - SHOW statements Each file corresponds to one documentation page from: https://doris.apache.org/docs/3.x/sql-manual/sql-statements/ Total: 153 SQL statements across 17 test files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * test(doris): add session and account management SQL examples Add 4 new test files: - session_variable.sql: SET/SHOW variable statements - session_context.sql: USE DATABASE, SWITCH CATALOG - account_grant.sql: GRANT privilege statements - account_revoke.sql: REVOKE privilege statements Total: 21 test files, 185 SQL statements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * test(doris): expand SQL test coverage with additional examples Add 29 new SQL test files and update existing ones to provide comprehensive test coverage across multiple Doris SQL feature categories: - Account management: alter user, drop user, roles, set password, show grants - Catalog operations: alter, create, drop, show catalogs - Cluster management: backend, broker, frontend, resource, storage, workload - Table operations: alter table (property, rename, replace, rollup) - Index operations: create, drop, build index - Async materialized views - Functions and plugins - Statistics, recovery, and security Total test files: 50 (up from 21) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * test(doris): add regression test folder for user scripts - Create examples/regression/ folder for user-reported SQL scripts - Update parser_test.go to recursively test subdirectories - Add first regression test: SHOW CREATE ROUTINE LOAD FOR 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * refactor(doris): use recursive directory walking for tests Use filepath.WalkDir to recursively find all .sql test files in the examples directory, allowing for arbitrarily nested subdirectories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * chore: update * chore: remove implementation plan docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 393e291 commit 866576a

File tree

78 files changed

+167308
-20602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+167308
-20602
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
id: set-matrix
3535
run: |
3636
# List of all available parsers
37-
ALL_PARSERS="redshift postgresql cql snowflake tsql doris trino plsql googlesql mysql partiql tidb mariadb cosmosdb"
37+
ALL_PARSERS="redshift postgresql cql snowflake tsql doris starrocks trino plsql googlesql mysql partiql tidb mariadb cosmosdb"
3838
# Add more parsers here as they are added to the repository
3939
# ALL_PARSERS="redshift mysql postgresql"
4040

0 commit comments

Comments
 (0)