sunxiaojian commented on code in PR #7186:
URL: https://github.com/apache/gravitino/pull/7186#discussion_r2102513316
##########
catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/utils/DorisUtils.java:
##########
@@ -220,4 +217,26 @@ public static Distribution
extractDistributionInfoFromSql(String createTableSql)
throw new RuntimeException("Failed to extract distribution info in sql:" +
createTableSql);
}
+
+ private static int extractBucketNum(Matcher matcher) {
+ int bucketNum = 1;
+ if (matcher.find(5)) {
+ String bucketValue = matcher.group(5);
+ if (bucketValue.trim().toUpperCase().equals("AUTO")) {
+ // Use -1 to indicate auto bucket.
+ bucketNum = -1;
+ } else {
+ bucketNum = Integer.valueOf(matcher.group(5));
+ }
+ }
+ return bucketNum;
+ }
+
+ public static String revertDistributionBucket(int number) {
Review Comment:
fixed
##########
api/src/main/java/org/apache/gravitino/rel/expressions/distributions/Distributions.java:
##########
@@ -74,6 +74,17 @@ public static Distribution of(Strategy strategy, int number,
Expression... expre
return new DistributionImpl(strategy, number, expressions);
}
+ /**
+ * Create a distribution by the given strategy, the number of buckets is not
used.
+ *
+ * @param strategy The strategy to use
+ * @param expressions The expressions to distribute by
+ * @return The created distribution
+ */
+ public static Distribution auto(Strategy strategy, Expression...
expressions) {
+ return new DistributionImpl(strategy, -1, expressions);
Review Comment:
fixed
--
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]