Skip to content

Commit

Permalink
Propagate Conf.default_bucket_num to CREATE TABLE AS SELECT. (#14160)
Browse files Browse the repository at this point in the history
Previously, Conf.default_bucket_num only applies to CREATE TABLE. CREATE TABLE AS SELECT used a hard-coded default bucket num of 10.

This PR propagates Conf.default_bucket_num to CREATE TABLE AS SELECT.

(cherry picked from commit 1ad9ab3)
  • Loading branch information
jiacheng-celonis authored and wanpengfei-git committed Nov 27, 2022
1 parent 1c262bb commit 7a6e908
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.starrocks.catalog.OlapTable;
import com.starrocks.catalog.Table;
import com.starrocks.catalog.Type;
import com.starrocks.common.Config;
import com.starrocks.common.Pair;
import com.starrocks.qe.ConnectContext;
import com.starrocks.server.GlobalStateMgr;
Expand Down Expand Up @@ -141,7 +142,7 @@ public static void analyze(CreateTableAsSelectStmt createTableAsSelectStmt, Conn
}
}

int defaultBucket = 10;
int defaultBucket = Config.default_bucket_num;
DistributionDesc distributionDesc =
new HashDistributionDesc(defaultBucket, Lists.newArrayList(defaultColumnName));
createTableStmt.setDistributionDesc(distributionDesc);
Expand Down

0 comments on commit 7a6e908

Please sign in to comment.