You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "AMashenkov (via GitHub)" <gi...@apache.org> on 2023/05/31 10:47:39 UTC

[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2105: IGNITE-19407 Sql. Introduce DDL command for ALTER COLUMN TYPE.

AMashenkov commented on code in PR #2105:
URL: https://github.com/apache/ignite-3/pull/2105#discussion_r1211510984


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java:
##########
@@ -214,6 +222,57 @@ public CompletableFuture<Void> dropColumn(AlterTableDropColumnParams params) {
         return failedFuture(new UnsupportedOperationException("Not implemented yet."));
     }
 
+    /** {@inheritDoc} */
+    @Override
+    public CompletableFuture<Void> alterColumn(AlterColumnParams params) {
+        return saveUpdate(catalog -> {
+            String schemaName = Objects.requireNonNullElse(params.schemaName(), CatalogService.PUBLIC);
+
+            SchemaDescriptor schema = Objects.requireNonNull(catalog.schema(schemaName), "No schema found: " + schemaName);
+
+            TableDescriptor table = schema.table(params.tableName());
+
+            if (table == null) {
+                if (params.ifTableExists()) {
+                    return Collections.emptyList();
+                }

Review Comment:
   "CREATE TABLE IF EXISTS" always throws an exception in such case.
   @korlov42 , do you agree to pass 'if exists' flags inside the parameters? 



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