mchades opened a new pull request, #11239:
URL: https://github.com/apache/gravitino/pull/11239
### What changes were proposed in this pull request?
This PR fixes StarRocks distribution parsing when loading tables whose `SHOW
CREATE TABLE` SQL does not include a `DISTRIBUTED BY` clause (for example,
external/Paimon-like table definitions).
- In `StarRocksUtils.extractDistributionInfoFromSql`, return
`Distributions.NONE` when `DISTRIBUTED BY` is absent.
- Keep strict behavior when `DISTRIBUTED BY` exists but cannot be parsed
(still throw runtime exception).
- Extend existing `TestStarRocksUtils.testDistributedInfoPattern` with:
- a no-distribution SQL case expecting `Distributions.NONE`
- an invalid distribution clause case expecting exception
### Why are the changes needed?
Issue #9515 reports table load failures with:
`Failed to extract distribution info in sql: CREATE TABLE ... PROPERTIES
(...)`
The root cause is that current StarRocks loading logic always parses
distribution info, while some table SQL does not contain `DISTRIBUTED BY`. This
patch makes that scenario loadable while preserving fail-fast behavior for
malformed distribution syntax.
Fix: #9515
### Does this PR introduce _any_ user-facing change?
- StarRocks table loading no longer fails for table SQL that does not define
`DISTRIBUTED BY`.
- No API changes.
- No property key additions/removals.
### How was this patch tested?
- Formatting:
- `./gradlew :catalogs:catalog-jdbc-starrocks:spotlessApply`
- Unit test:
- `./gradlew :catalogs:catalog-jdbc-starrocks:test --tests
org.apache.gravitino.catalog.starrocks.utils.TestStarRocksUtils -PskipITs`
- Result: BUILD SUCCESSFUL.
--
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]