JNSimba commented on code in PR #288:
URL:
https://github.com/apache/doris-flink-connector/pull/288#discussion_r1446932251
##########
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:
Why not use equals here?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]