vinlee19 commented on code in PR #288: URL: https://github.com/apache/doris-flink-connector/pull/288#discussion_r1447108522
########## flink-doris-connector/src/main/java/org/apache/doris/flink/catalog/doris/DorisSystem.java: ########## @@ -199,11 +200,28 @@ public static String buildCreateTableDDL(TableSchema schema) { // append distribute key sb.append(" DISTRIBUTED BY HASH(") .append(String.join(",", identifier(schema.getDistributeKeys()))) - .append(") BUCKETS AUTO "); + .append(")"); + Map<String, String> properties = schema.getProperties(); + if (schema.getTableBuckets() != null) { + + int bucketsNum = schema.getTableBuckets(); + if (bucketsNum <= 0) { + throw new CreateTableException("The number of buckets must be positive."); + } + sb.append(" BUCKETS ").append(bucketsNum); + } else { + sb.append(" BUCKETS AUTO "); + } // append properties int index = 0; - for (Map.Entry<String, String> entry : schema.getProperties().entrySet()) { + int skipProNum = 0; + for (Map.Entry<String, String> entry : properties.entrySet()) { + // skip table-buckets + if (entry.getKey().contains(TABLE_BUCKETS)) { Review Comment: Thoughtless -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org