apache/gravitino

[Improvement] Fix AUTO handling in DorisUtils.java

Open

#8,344 opened on 2025年8月28日

GitHub で見る
 (6 comments) (0 reactions) (1 assignee)Java (887 forks)auto 404
good first issueimprovement

Repository metrics

Stars
 (3,058 stars)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド