Skip to content

Doris SQL: add Doris Dialect#2380

Open
finchxxia wants to merge 2 commits into
apache:mainfrom
finchxxia:draft/doris-dialect-support
Open

Doris SQL: add Doris Dialect#2380
finchxxia wants to merge 2 commits into
apache:mainfrom
finchxxia:draft/doris-dialect-support

Conversation

@finchxxia

@finchxxia finchxxia commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Doris SQL dialect support to close #2379

This is PR 1 of a stacked Doris SQL support series. It contains only the shared AUTO_INCREMENT AST cleanup and the Doris dialect skeleton. Follow-up draft PRs add CREATE TABLE table models, LOAD DATA INFILE, and CREATE ROUTINE LOAD support.

This PR introduces DorisDialect and parser/AST support for common Doris SQL syntax, especially Doris CREATE TABLE clauses, partition/distribution definitions, table properties, Doris column options, and Doris load statements.

Changes

  • Add DorisDialect

    • backtick-delimited identifiers
    • Doris-style identifiers
    • backslash string escapes
    • Doris-specific parser capability gates
  • Add Doris CREATE TABLE support

    • ENGINE = OLAP
    • DUPLICATE KEY, UNIQUE KEY, AGGREGATE KEY
    • table-level COMMENT
    • PARTITION BY RANGE/LIST
    • AUTO PARTITION
    • partition values including MAXVALUE / MAX_VALUE
    • fixed and batch range partitions
    • DISTRIBUTED BY HASH/RANDOM
    • BUCKETS <n> and BUCKETS AUTO
    • PROPERTIES (...)
  • Add Doris AST structures

    • key model
    • partition model
    • distribution model
    • bucket declarations
    • Doris load statements
  • Add Doris-specific statement parsing

    • LOAD DATA INFILE
    • CREATE ROUTINE LOAD
  • Extend tests

    • Doris round-trip parser tests
    • structured AST assertions
    • generic/ANSI rejection cases for Doris-only syntax
    • table comment escaping
    • compatibility checks for surrounding dialect behavior

Testing

cargo fmt --check
cargo test --test sqlparser_doris

@finchxxia finchxxia marked this pull request as draft June 17, 2026 08:28
@finchxxia finchxxia force-pushed the draft/doris-dialect-support branch from fc16163 to a55690c Compare June 17, 2026 08:35
@LucaCappelletti94

Copy link
Copy Markdown
Contributor

2500 lines of a PR are a bit too many, could you fracture this down into smaller reviewable units?

@finchxxia

Copy link
Copy Markdown
Contributor Author

2500 lines of a PR are a bit too many, could you fracture this down into smaller reviewable units?

@LucaCappelletti94 Of course, I would do that later and add more info in issue link #2379

@finchxxia finchxxia force-pushed the draft/doris-dialect-support branch from ecca2d6 to bffa3fd Compare June 18, 2026 05:21
@finchxxia finchxxia marked this pull request as ready for review June 18, 2026 06:15
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.

DorisSQL: add Doris Dialect

2 participants