You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/11/30 15:52:36 UTC

[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #1385: IGNITE-18157 Sql. Provide commands and handlers for distributed zones related operations

ygerzhedovich commented on code in PR #1385:
URL: https://github.com/apache/ignite-3/pull/1385#discussion_r1036146526


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ddl/DdlCommandHandler.java:
##########
@@ -197,17 +238,17 @@ private CompletableFuture<Boolean> handleAlterDropColumn(AlterTableDropCommand c
         }
 
         return dropColumnInternal(cmd.tableName(), cmd.columns(), cmd.ifColumnExists())
-                .handle(handleTableModificationResult(cmd.ifTableExists()));
+                .handle(handleModificationResult(cmd.ifTableExists(), TableNotFoundException.class));
     }
 
-    private static BiFunction<Object, Throwable, Boolean> handleTableModificationResult(boolean ignoreTableExistenceErrors) {
+    private static BiFunction<Object, Throwable, Boolean> handleModificationResult(boolean ignoreExpectedError, Class<?> expErrCls) {
         return (val, err) -> {
             if (err == null) {
                 return val instanceof Boolean ? (Boolean) val : Boolean.TRUE;
-            } else if (ignoreTableExistenceErrors) {
+            } else if (ignoreExpectedError) {
                 Throwable err0 = err instanceof CompletionException ? err.getCause() : err;
 
-                if (err0 instanceof TableAlreadyExistsException || err0 instanceof TableNotFoundException) {
+                if (expErrCls.isInstance(err0)) {

Review Comment:
   sems you invert condition here



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org