[#11590] fix(doris): fix partition parsing for Doris 3.0+ format - #11732
Conversation
Code Coverage Report
Files
|
There was a problem hiding this comment.
Pull request overview
Improves Apache Doris catalog compatibility (Doris 3.0+ SHOW CREATE TABLE output) by making partition parsing more tolerant to whitespace and more robust for LIST partition definitions, with corresponding unit test updates.
Changes:
- Relaxed partition header regex to tolerate whitespace and updated partition column splitting/backtick handling.
- Added LIST partition assignment parsing that can handle nested parentheses for multi-column LIST values.
- Updated/expanded
TestDorisUtilscases and migrated assertions to JUnit JupiterAssertions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/utils/DorisUtils.java | Updates partition regex and adds LIST partition assignment parsing logic. |
| catalogs/catalog-jdbc-doris/src/test/java/org/apache/gravitino/catalog/doris/utils/TestDorisUtils.java | Expands partition parsing tests (including Doris 3.0+ spacing) and switches to JUnit Jupiter assertions. |
badba44 to
b62a75e
Compare
|
Thanks for the review. After checking each comment against the actual PR diff:
|
|
@Copilot Please trigger the CI workflow. |
|
@jiangxt2 |
…s for Doris 1.2.x/3.0.x/4.0.x Signed-off-by: jiangxt2 <jiangxt2@vip.qq.com>
e37a713 to
4285945
Compare
|
Rebased onto latest main to resolve conflicts with #11763, and fixed test issues found during local Docker IT runs. Changes:
Local Docker IT results:
|
| private static final Pattern PARTITION_INFO_PATTERN = | ||
| Pattern.compile("PARTITION BY \\b(LIST|RANGE)\\b\\((.+)\\)"); | ||
| Pattern.compile("PARTITION BY \\b(LIST|RANGE)\\b\\s*\\((.+)\\)"); | ||
|
|
There was a problem hiding this comment.
Updated the PR body to accurately reflect the actual code changes.
The previous description overstated the scope — it included Copilot suggestions (comma/backtick/bracket-depth parsing improvements) that were never implemented. The actual change is a single-line regex fix (\s* in PARTITION_INFO_PATTERN) plus integration test coverage for partition round-trip across all three Doris versions.
…pace tolerance Add test cases for Doris 3.0+ SHOW CREATE TABLE format where LIST/RANGE keywords are followed by a space before the opening parenthesis. Signed-off-by: jiangxt2 <jiangxt2@vip.qq.com>
|
Hi @yuqi1129, the CI failures are from |
What changes were proposed in this pull request?
Partition Regex Fix (
DorisUtils.java)\\s*toPARTITION_INFO_PATTERNto tolerate whitespace betweenLIST/RANGEand(in Doris 3.0+SHOW CREATE TABLEoutput (PARTITION BY LIST (vsPARTITION BY LIST()Integration Tests
CatalogDorisIT(1.2.x):testListPartitionRoundTrip+testMultiColumnListPartitionRoundTripCatalogDoris3xIT(3.0.x):testListPartitionRoundTrip+testRangePartitionRoundTripCatalogDoris4xIT(4.0.x):testListPartitionRoundTrip+testRangePartitionRoundTripAll tests verify partition metadata survives the create → Doris → load round-trip.
Fixed: #11590
Does this PR introduce any user-facing change?
No. Partition parsing fix is internal to Gravitino metadata loading.
How was this patch tested?
Unit tests:
TestDorisUtils(existing, covers both LIST and RANGE parsing)Integration tests (Docker, all three Doris versions):
CatalogDorisIT(1.2.x): 19/19 passedCatalogDoris3xIT(3.0.x): 8/8 passedCatalogDoris4xIT(4.0.x): 8/8 passed