apache / apache/gravitino

[Improvement] Fix AUTO handling in DorisUtils.java

Open
#8,344 6 comments 0 reactions 1 assignee Claimed by @Eipi-Tong View on GitHub
good first issue improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### What would you like to be improved?

In catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/utils/DorisUtils.java, checks for a missing bucket group, preventing errors when the BUCKETS clause is absent and defaulting to 1 or AUTO as appropriate.

Here's a test to help:
```
@Test
public void testDistributionWithoutBucketClauseDefaultsToOne() {
String createTableSql =
"CREATE TABLE `testTable` (\n" +
"`col1` date NOT NULL\n) ENGINE=OLAP\n PARTITION BY RANGE(`col1`)\n()\n DISTRIBUTED BY HASH(`col1` )";
Distribution distribution = DorisUtils.extractDistributionInfoFromSql(createTableSql);
assertEquals(distribution.number(), 1);
}
```

### How should we improve?

see above

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.