jiangxt2 opened a new pull request, #11732:
URL: https://github.com/apache/gravitino/pull/11732
## What changes were proposed in this pull request?
### Partition Regex Fix (`DorisUtils.java`)
- Added `\\s*` to `PARTITION_INFO_PATTERN` to tolerate whitespace between
`LIST`/`RANGE` and `(` in Doris 3.0+ `SHOW CREATE TABLE` output (`PARTITION BY
LIST (` vs `PARTITION BY LIST(`)
### Partition Column Extraction Fix (Copilot C3)
- Changed `split(", ")` to `split(",")` + `trim()` to handle commas with or
without trailing space
- Added backtick detection and stripping for column names
### Multi-column LIST Partition Parsing
- Replaced regex-based parsing with bracket-depth-aware manual scan to
correctly handle nested parentheses in `VALUES IN (("a", 1), ("b", 2))`
### Backtick Partition Name Support (Copilot C4)
- Updated regex from `(\\w+)` to `(?:\\x60(\\w+)\\x60|(\\w+))` to match both
backtick-quoted and bare partition names
- Partition name extracted from group(1) (backtick) or group(2) (bare),
whichever is non-null
### Test Coverage (Copilot C5)
- Added test case with backtick-quoted partition names (`PARTITION
\\x60p1\\x60 VALUES IN (...)`)
## Does this PR introduce any user-facing change?
No. Partition parsing improvements are internal to Gravitino metadata
loading.
## How was this patch tested?
Unit tests in `TestDorisUtils`:
- `testExtractPartitionInfoFromSql`: RANGE/LIST with/without spaces,
multi-column LIST, backtick partition names, non-partitioned tables
- `testGeneratePartitionSqlFragment`: RANGE MAXVALUE, LIST
single/multi/multi-column values
Integration tests (Doris 4.0.6 and 3.0.6.2):
- LIST partition with backtick names: Gravitino correctly reads partition
info
- RANGE partition: Gravitino correctly identifies range strategy
- Partition column/value/name extraction verified
Related to #11590
--
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]