[ https://issues.apache.org/jira/browse/IGNITE-22197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922357#comment-17922357 ]
Iurii Gerzhedovich commented on IGNITE-22197: --------------------------------------------- merged commit [{{a290127}}|https://github.com/apache/ignite-3/commit/a2901275299619a4c84a25e6e62a56615bfc2c48] into main > Move DDL 'IF EXISTS` flag handling inside the catalog command > ------------------------------------------------------------- > > Key: IGNITE-22197 > URL: https://issues.apache.org/jira/browse/IGNITE-22197 > Project: Ignite > Issue Type: Improvement > Components: sql > Reporter: Pavel Pereslegin > Assignee: Iurii Gerzhedovich > Priority: Major > Labels: ignite-3 > > Currently, the catalog command itself does not handle the 'IF EXISTS' 'IF NOT > EXISTS' flags. We handle the exception thrown by the command and set the > result to false if the flag was set. And this result (true/false) can be > obtained by the user using {{AsyncResultSet#wasApplied}} method. > With the current approach, a problem may arise when processing a batch > command. > For example > {code:sql} > CREATE TABLE IF NOT EXISTS Person... -- command 1 > CREATE TABLE IF NOT EXISTS City... -- command 2 > {code} > If the Person table exists, the batch will not be fully executed. > To address this we can move flag handling inside the command itself. > To keep "wasApplied" working, we can rework a bit {{CatalogManager#execute}} > so that it returns not only the catalog version, but also a flag indicating > that something was changed when this command was executed. -- This message was sent by Atlassian Jira (v8.20.10#820010)