[
https://issues.apache.org/jira/browse/IGNITE-27809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18058396#comment-18058396
]
Ivan Zlenko commented on IGNITE-27809:
--------------------------------------
Implementation details:
For ALTER TABLE COLUMN ADD supported option to specify IF NOT EXISTS keyword.
In that case if column is already exists query will be executed successfully
without schema modification. The same applies for batch version of the request.
If multiple columns should be added to the table, then query to be executed
successfully ignoring columns, which already exists.
For ALTER TABLE COLUMN DROP supported option to specify IF EXISTS keyword. In
that case if column is not exists query will be executed successfully without
schema modification.
> SQL ALTER TABLE ADD COLUMN to support IF NOT EXISTS
> ---------------------------------------------------
>
> Key: IGNITE-27809
> URL: https://issues.apache.org/jira/browse/IGNITE-27809
> Project: Ignite
> Issue Type: New Feature
> Reporter: Ivan Zlenko
> Assignee: Ivan Zlenko
> Priority: Major
> Labels: ignite-3
> Time Spent: 10m
> Remaining Estimate: 0h
>
> We should support following syntax:
> {{alter table tableName add [column] if not exists column_name int;}}
> * if tableName has no column yet, it will create
> * if tableName has the column already, no exception is thrown
> PS. We can extend this also to {{DROP COLUMN IF EXISTS}} functionality.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)