[ 
https://issues.apache.org/jira/browse/IGNITE-5572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16110655#comment-16110655
 ] 

Vladimir Ozerov commented on IGNITE-5572:
-----------------------------------------

[~al.psc], prelimitar comments:
1) There is not need to restrict alter operation to {{PUBLIC}} schema only. 
This restriction makes sense only for tables.
2) Let's remove support for {{BEFORE}} and {{AFTER}} statements. With current 
implementation this is merely a cosmetic change for {{SELECT *}} query, it 
doesn't affect any Ignite storage internals. Hence, no need to expose it to 
users.
3) {{runDdlStatement}} - there is no need to have separate if-else branches 
when there are one or more than one columns; this is a micro-optimization in 
non-performance-sensitive place, which optimizes nothing.
4) We need to throw exceptions for unsupported futures [1]: {{NOT NULL}}, 
{{UNIQUE}}, {{VISIBLE}}, {{INVISIBLE}}, {{DEFAULT}}, {{AS}}, 
{{AUTO_INCREMENT}}, {{IDENTITY}}, {{SELECTIVITY}} , {{COMMENT}}, {{HASH}}, 
{{CHECK}}. I think we missed this piece for {{CREATE TABLE}} as well. Let's 
create a common fix for both.
5) {{IgniteH2Indexing.dynamicAddColumn}} - we must re-create SQL script and 
execute it over H2 engine in the same way we did that for other DDL commands. 
Otherwise we are risking that some H2 internals will not reflect the changes, 
or that improper locking will be applied.

[1] http://www.h2database.com/html/grammar.html#column_definition

> DDL: Support ALTER TABLE ADD COLUMN
> -----------------------------------
>
>                 Key: IGNITE-5572
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5572
>             Project: Ignite
>          Issue Type: Task
>          Components: sql
>            Reporter: Vladimir Ozerov
>            Assignee: Alexander Paschenko
>             Fix For: 2.2
>
>
> We should start gradual implementation of {{ALTER TABLE}} command. Let's 
> start with the most simple part - {{ADD COLUMN}}. Proposed design:
> 1) Send a message over a ring, similar to how we do that for create index
> 2) On local node: update relevant QueryEntity, update data strcutrues in 
> {{GridQueryProcessor}}, update {{IgniteH2Indexing}} data structures, execute 
> {{ALTER TABLE}} command on H2 database (global table lock must be acquired).
> 3) Make sure that update to {{QueryEntity}} is properly saved if persistence 
> is enabled.
> Feature should be covered with tests thoroughly:
> 1) Positive cases
> 2) Negative cases (no schema, no table, column already exists)
> 3) Test with concurrent SQL operations
> 4) Test with concurrent node restarts



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to