FANNG1 commented on code in PR #10721:
URL: https://github.com/apache/gravitino/pull/10721#discussion_r3086870178


##########
catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/GravitinoPaimonTable.java:
##########
@@ -228,31 +233,50 @@ private static List<String> getBucketKeys(Distribution 
distribution) {
         .collect(Collectors.toList());
   }
 
-  static Distribution getDistribution(Map<String, String> properties) {
+  static Distribution getDistribution(Map<String, String> properties, 
List<String> primaryKeys) {
     if (properties == null) {
       return Distributions.NONE;
     }
+
+    // Resolve bucket key columns: explicit bucket-key, else fall back to PK
     String bucketKeys = properties.get(BUCKET_KEY);
-    if (StringUtils.isBlank(bucketKeys)) {
-      return Distributions.NONE;
+    List<String> bucketKeyList;
+    if (StringUtils.isNotBlank(bucketKeys)) {
+      bucketKeyList =
+          Arrays.stream(bucketKeys.split(","))
+              .map(String::trim)
+              .filter(StringUtils::isNotBlank)
+              .collect(Collectors.toList());
+    } else {
+      bucketKeyList = (primaryKeys != null) ? primaryKeys : 
Collections.emptyList();
     }
-    List<String> bucketKeyList =
-        Arrays.stream(bucketKeys.split(","))
-            .map(String::trim)
-            .filter(StringUtils::isNotBlank)
-            .collect(Collectors.toList());
+
+    String bucketValue = properties.get(BUCKET_NUM);

Review Comment:
   could you renmae `bucketValue` to `bucketNum` to make it more clear?



-- 
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]

Reply via email to