finchxxia opened a new issue, #2379:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/2379
# Doris SQL: Support Doris Dialect
## Summary
Add Doris SQL dialect, covering the core Doris syntax needed to parse common
Doris DDL and load statements.
## Motivation
Apache Doris has SQL syntax that differs from the generic SQL dialect,
especially around `CREATE TABLE` clauses, key models, partition/distribution
definitions, table properties, and Doris-specific load statements. A dedicated
`DorisDialect` would let users parse Doris SQL without weakening generic parser
behavior.
## Proposed Scope
- Add `DorisDialect`
- Support Doris `CREATE TABLE` clauses:
- `ENGINE = OLAP`
- `DUPLICATE KEY`, `UNIQUE KEY`, `AGGREGATE KEY`
- table `COMMENT`
- `PARTITION BY RANGE/LIST`
- `AUTO PARTITION`
- `DISTRIBUTED BY HASH/RANDOM`
- `BUCKETS` / `BUCKETS AUTO`
- `PROPERTIES (...)`
- Support Doris column options such as `AUTO_INCREMENT`
- Support Doris `LOAD DATA INFILE`
- Support Doris `CREATE ROUTINE LOAD`
- Preserve generic dialect behavior where Doris-only syntax should remain
rejected
## Parser / AST Changes
- Add Doris-specific AST structures for key model, partition, distribution,
table properties, and load statements
- Extend `CreateTable` with optional Doris-specific fields
- Add `Display` support for canonical SQL rendering
- Add span support for newly introduced AST nodes where applicable
## Tests
Add Doris parser tests covering:
- Positive Doris parsing cases
- Generic/ANSI rejection cases for Doris-only syntax
- AST structure assertions
- Round-trip canonical rendering
- Escaping behavior for table comments containing single quotes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]