apache/gravitino

[Improvement] Fix AUTO handling in DorisUtils.java

Open

#8,344 创建于 2025年8月28日

在 GitHub 查看
 (6 评论) (0 反应) (1 负责人)Java (887 fork)auto 404
good first issueimprovement

仓库指标

Star
 (3,058 star)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南