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


##########
catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/PaimonCatalogOperations.java:
##########
@@ -501,6 +502,74 @@ private void checkPaimonIndexes(Index[] indexes) {
                     "Paimon only supports primary key Index."));
   }
 
+  private void validateDistribution(Distribution distribution, Column[] 
columns, Index[] indexes) {
+    if (distribution == null || distribution.strategy() == 
Distributions.NONE.strategy()) {
+      return;
+    }
+
+    Preconditions.checkArgument(
+        distribution.strategy() == Strategy.HASH,
+        "Paimon only supports HASH distribution strategy.");
+
+    Preconditions.checkArgument(
+        distribution.expressions() != null && 
distribution.expressions().length > 0,
+        "Paimon bucket keys must be specified for HASH distribution.");
+
+    int bucketNumber = distribution.number();
+    Preconditions.checkArgument(
+        bucketNumber == Distributions.AUTO || bucketNumber > 0,
+        "Paimon bucket number must be positive or AUTO.");
+
+    List<String> bucketKeys = extractBucketKeys(distribution);
+    List<String> columnNames =
+        Arrays.stream(columns).map(Column::name).collect(Collectors.toList());
+    bucketKeys.forEach(
+        bucketKey ->
+            Preconditions.checkArgument(
+                columnNames.stream().anyMatch(name -> 
name.equalsIgnoreCase(bucketKey)),

Review Comment:
   updated



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