diqiu50 commented on code in PR #10088:
URL: https://github.com/apache/gravitino/pull/10088#discussion_r2883408356


##########
catalogs-contrib/catalog-jdbc-clickhouse/src/main/java/org/apache/gravitino/catalog/clickhouse/operations/ClickHouseTableOperations.java:
##########
@@ -343,22 +345,20 @@ private void handleDistributeTable(
     Preconditions.checkArgument(
         StringUtils.isNotBlank(shardingKey), "Sharding key must be specified 
for Distributed");
 
-    List<String> shardingColumns = 
ClickHouseTableSqlUtils.extractShardingKeyColumns(shardingKey);
-    if (CollectionUtils.isNotEmpty(shardingColumns)) {
-      for (String columnName : shardingColumns) {
-        JdbcColumn shardingColumn = findColumn(columns, columnName);
-        Preconditions.checkArgument(
-            shardingColumn != null,
-            "Sharding key column %s must be defined in the table",
-            columnName);
-      }
-    }
+    // When creating a distributed table, the columns should be empty as the 
distributed table will
+    // reference the remote table's columns, and the sharding key must be 
defined in the columns.
+    Preconditions.checkArgument(
+        ArrayUtils.isEmpty(columns),
+        "Columns should be empty when creating a distributed table, but got: 
%s",
+        Arrays.toString(columns));

Review Comment:
   The distribution table can have its own columns.



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