Skip to content

Support parsing Doris CREATE TABLE multi range partition and per-partition properties syntax#39201

Open
ealeonraz wants to merge 1 commit into
apache:masterfrom
ealeonraz:doris-create-table-partition-parsing
Open

Support parsing Doris CREATE TABLE multi range partition and per-partition properties syntax#39201
ealeonraz wants to merge 1 commit into
apache:masterfrom
ealeonraz:doris-create-table-partition-parsing

Conversation

@ealeonraz

Copy link
Copy Markdown

Fixes #31495.

Changes proposed in this pull request:

  • Support Doris multi-range partition items in CREATE TABLE partition definitions: FROM (...) TO (...) INTERVAL n [unit] (date/hour/integer variants), reusing the same shape as the existing ALTER TABLE ... ADD PARTITIONS rule
  • Support Doris fixed-range partition values PARTITION p VALUES [(...), (...)) in CREATE TABLE, mirroring the existing dorisPartitionDesc rule used by ALTER TABLE
  • Support per-partition property lists after the values clause, e.g. PARTITION p1 VALUES LESS THAN ('2022-01-01') ('storage_policy' = '...', 'replication_num'='1'), reusing the existing properties rule
  • Add 4 SQL cases + assert cases; InternalDorisParserIT passes (1261 tests, 0 failures)

Notes on the issue's SQL case list: the example_db.table_hash case already parses on current master (no change needed, so no assert added per the issue guidance); the scraped fragments (CREATE, TABLE, array-function signatures, STRING) are not valid standalone statements and were ignored per the issue guidance.


Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.
  • I have updated the Release Notes of the current development version. For more details, see Update Release Note

@ealeonraz ealeonraz mentioned this pull request Jul 21, 2026
1 task
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.

Support parsing Doris sql

1 participant