senlizishi commented on code in PR #7621:
URL: https://github.com/apache/gravitino/pull/7621#discussion_r2196356574


##########
catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java:
##########
@@ -774,7 +774,7 @@ static String addIndexDefinition(TableChange.AddIndex 
addIndex) {
 
   static String deleteIndexDefinition(
       JdbcTable lazyLoadTable, TableChange.DeleteIndex deleteIndex) {
-    if (deleteIndex.isIfExists()) {
+    if (!deleteIndex.isIfExists()) {
       Preconditions.checkArgument(
           Arrays.stream(lazyLoadTable.index())
               .anyMatch(index -> index.name().equals(deleteIndex.getName())),

Review Comment:
   > I'm puzzled that since you use `!deleteIndex.isIfExists()` in L777, should 
this place be `nonMatch` NOT `anyMatch` here?
   
   Thank you for your review. My understanding is that when 
deleteIndex.isIfExists() is false, the code block will be entered. Next, check 
whether the name of any index in lazyLoadTable is the same as 
deleteIndex.getName(). If it is the same, it will run normally. Otherwise, it 
will report an Index does not exist exception. I don't know if my understanding 
is correct ?



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