yuqi1129 commented on code in PR #10383:
URL: https://github.com/apache/gravitino/pull/10383#discussion_r2946291452


##########
catalogs-contrib/catalog-jdbc-clickhouse/src/main/java/org/apache/gravitino/catalog/clickhouse/operations/ClickHouseTableOperations.java:
##########
@@ -768,6 +827,36 @@ protected String generateAlterTableSql(
     return result;
   }
 
+  private String addIndexDefinition(JdbcTable table, TableChange.AddIndex 
addIndex) {
+    Preconditions.checkArgument(
+        StringUtils.isNotBlank(addIndex.getName()), "Index name is required");
+    Preconditions.checkArgument(
+        ArrayUtils.isNotEmpty(addIndex.getFieldNames()), "Index field names 
are required");
+
+    boolean indexExists =
+        Arrays.stream(table.index()).anyMatch(index -> 
index.name().equals(addIndex.getName()));
+    Preconditions.checkArgument(!indexExists, "Index '%s' already exists", 
addIndex.getName());
+
+    String fieldStr = getIndexFieldStr(addIndex.getFieldNames());
+    switch (addIndex.getType()) {
+      case DATA_SKIPPING_MINMAX:
+        return "ADD INDEX %s %s TYPE minmax GRANULARITY 1"

Review Comment:
   Constant `1` and `3` in L847 will be tracked by 
https://github.com/apache/gravitino/issues/10446



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