[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16926600#comment-16926600
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

arina-ielchiieva commented on pull request #1850: DRILL-7168: Implement ALTER 
SCHEMA ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850
 
 
   
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting, ready-to-commit
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16926534#comment-16926534
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

vvysotskyi commented on pull request #1850: DRILL-7168: Implement ALTER SCHEMA 
ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850#discussion_r322688169
 
 

 ##
 File path: exec/java-exec/src/main/codegen/includes/parserImpls.ftl
 ##
 @@ -534,6 +534,110 @@ SqlNode SqlDescribeSchema() :
)
 }
 
+/**
+* Parses ALTER SCHEMA statements:
+*
+* ALTER SCHEMA
+* (FOR TABLE dfs.tmp.nation | PATH '/tmp/schema.json')
+* ADD [OR REPLACE]
+* [COLUMNS (col1 int, col2 varchar)]
+* [PROPERTIES ('prop1'='val1', 'prop2'='val2')]
+*
+* ALTER SCHEMA
+* (FOR TABLE dfs.tmp.nation | PATH '/tmp/schema.json')
+* REMOVE
+* [COLUMNS (`col1`, `col2`)]
+* [PROPERTIES ('prop1', 'prop2')]
+*/
+SqlNode SqlAlterSchema() :
+{
+   SqlParserPos pos;
+   SqlIdentifier table = null;
+   SqlNode path = null;
+}
+{
+{ pos = getPos(); }
+   
+(
+  { table = CompoundIdentifier(); }
+|
+ { path = StringLiteral(); }
+)
+(
+ { return SqlAlterSchemaAdd(pos, table, path); }
+|
+ { return SqlAlterSchemaRemove(pos, table, path); }
+)
+}
+
+SqlNode SqlAlterSchemaAdd(SqlParserPos pos, SqlIdentifier table, SqlNode path) 
:
+{
+   boolean replace = false;
+   SqlCharStringLiteral schema = null;
+   SqlNodeList properties = null;
+}
+{
+   [   { replace = true; } ]
+   [  { schema = ParseSchema(); } ]
+   [
+
+{
+ properties = new SqlNodeList(getPos());
+ addProperty(properties);
+}
+(
+  { addProperty(properties); }
+)*
+
+   ]
+   {
+if (schema == null && properties == null) {
+ throw new ParseException("ALTER SCHEMA ADD command must have at 
least  or  keyword indicated.");
+}
+return new SqlSchema.Add(pos, table, path, 
SqlLiteral.createBoolean(replace, getPos()), schema, properties);
+   }
+}
+
+SqlCharStringLiteral ParseSchema() :
 
 Review comment:
   Ok, thanks a lot for a detailed explanation.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16926529#comment-16926529
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

arina-ielchiieva commented on issue #1850: DRILL-7168: Implement ALTER SCHEMA 
ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850#issuecomment-529888167
 
 
   @vvysotskyi thanks for the review, addressed code review comments.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16926527#comment-16926527
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

arina-ielchiieva commented on pull request #1850: DRILL-7168: Implement ALTER 
SCHEMA ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850#discussion_r322683341
 
 

 ##
 File path: exec/java-exec/src/main/codegen/includes/parserImpls.ftl
 ##
 @@ -534,6 +534,110 @@ SqlNode SqlDescribeSchema() :
)
 }
 
+/**
+* Parses ALTER SCHEMA statements:
+*
+* ALTER SCHEMA
+* (FOR TABLE dfs.tmp.nation | PATH '/tmp/schema.json')
+* ADD [OR REPLACE]
+* [COLUMNS (col1 int, col2 varchar)]
+* [PROPERTIES ('prop1'='val1', 'prop2'='val2')]
+*
+* ALTER SCHEMA
+* (FOR TABLE dfs.tmp.nation | PATH '/tmp/schema.json')
+* REMOVE
+* [COLUMNS (`col1`, `col2`)]
+* [PROPERTIES ('prop1', 'prop2')]
+*/
+SqlNode SqlAlterSchema() :
+{
+   SqlParserPos pos;
+   SqlIdentifier table = null;
+   SqlNode path = null;
+}
+{
+{ pos = getPos(); }
+   
+(
+  { table = CompoundIdentifier(); }
+|
+ { path = StringLiteral(); }
+)
+(
+ { return SqlAlterSchemaAdd(pos, table, path); }
+|
+ { return SqlAlterSchemaRemove(pos, table, path); }
+)
+}
+
+SqlNode SqlAlterSchemaAdd(SqlParserPos pos, SqlIdentifier table, SqlNode path) 
:
+{
+   boolean replace = false;
+   SqlCharStringLiteral schema = null;
+   SqlNodeList properties = null;
+}
+{
+   [   { replace = true; } ]
+   [  { schema = ParseSchema(); } ]
+   [
+
+{
+ properties = new SqlNodeList(getPos());
+ addProperty(properties);
+}
+(
+  { addProperty(properties); }
+)*
+
+   ]
+   {
+if (schema == null && properties == null) {
+ throw new ParseException("ALTER SCHEMA ADD command must have at 
least  or  keyword indicated.");
+}
+return new SqlSchema.Add(pos, table, path, 
SqlLiteral.createBoolean(replace, getPos()), schema, properties);
+   }
+}
+
+SqlCharStringLiteral ParseSchema() :
 
 Review comment:
   No, all because of context switch, for create schema we use load and 
paren_string where each returns some specific result and one of push returns to 
default context. For alter schema add we use only paren_string and only this 
one can return to default context. The reason it is factored out into separate 
method is to prevent lookahead. Since first we need context switch and only 
then token search. With this method inline lookahead was happening before 
context switch and token from different context was never found.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16926525#comment-16926525
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

arina-ielchiieva commented on pull request #1850: DRILL-7168: Implement ALTER 
SCHEMA ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850#discussion_r322681171
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/metadata/schema/StorageProperties.java
 ##
 @@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.record.metadata.schema;
+
+import org.apache.drill.exec.store.StorageStrategy;
+
+/**
+ * Holds storage properties used when writing schema container.
+ */
+public class StorageProperties {
+
+  private StorageStrategy storageStrategy;
 
 Review comment:
   Done. Thanks for noticing.
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16924956#comment-16924956
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

vvysotskyi commented on pull request #1850: DRILL-7168: Implement ALTER SCHEMA 
ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850#discussion_r321977497
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/metadata/schema/StorageProperties.java
 ##
 @@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.record.metadata.schema;
+
+import org.apache.drill.exec.store.StorageStrategy;
+
+/**
+ * Holds storage properties used when writing schema container.
+ */
+public class StorageProperties {
+
+  private StorageStrategy storageStrategy;
 
 Review comment:
   final
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16924955#comment-16924955
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

vvysotskyi commented on pull request #1850: DRILL-7168: Implement ALTER SCHEMA 
ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850#discussion_r321977051
 
 

 ##
 File path: exec/java-exec/src/main/codegen/includes/parserImpls.ftl
 ##
 @@ -534,6 +534,110 @@ SqlNode SqlDescribeSchema() :
)
 }
 
+/**
+* Parses ALTER SCHEMA statements:
+*
+* ALTER SCHEMA
+* (FOR TABLE dfs.tmp.nation | PATH '/tmp/schema.json')
+* ADD [OR REPLACE]
+* [COLUMNS (col1 int, col2 varchar)]
+* [PROPERTIES ('prop1'='val1', 'prop2'='val2')]
+*
+* ALTER SCHEMA
+* (FOR TABLE dfs.tmp.nation | PATH '/tmp/schema.json')
+* REMOVE
+* [COLUMNS (`col1`, `col2`)]
+* [PROPERTIES ('prop1', 'prop2')]
+*/
+SqlNode SqlAlterSchema() :
+{
+   SqlParserPos pos;
+   SqlIdentifier table = null;
+   SqlNode path = null;
+}
+{
+{ pos = getPos(); }
+   
+(
+  { table = CompoundIdentifier(); }
+|
+ { path = StringLiteral(); }
+)
+(
+ { return SqlAlterSchemaAdd(pos, table, path); }
+|
+ { return SqlAlterSchemaRemove(pos, table, path); }
+)
+}
+
+SqlNode SqlAlterSchemaAdd(SqlParserPos pos, SqlIdentifier table, SqlNode path) 
:
+{
+   boolean replace = false;
+   SqlCharStringLiteral schema = null;
+   SqlNodeList properties = null;
+}
+{
+   [   { replace = true; } ]
+   [  { schema = ParseSchema(); } ]
+   [
+
+{
+ properties = new SqlNodeList(getPos());
+ addProperty(properties);
+}
+(
+  { addProperty(properties); }
+)*
+
+   ]
+   {
+if (schema == null && properties == null) {
+ throw new ParseException("ALTER SCHEMA ADD command must have at 
least  or  keyword indicated.");
+}
+return new SqlSchema.Add(pos, table, path, 
SqlLiteral.createBoolean(replace, getPos()), schema, properties);
+   }
+}
+
+SqlCharStringLiteral ParseSchema() :
 
 Review comment:
   Is it possible to reuse this code in `SqlCreateSchema`?
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (DRILL-7168) Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

2019-09-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DRILL-7168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16921346#comment-16921346
 ] 

ASF GitHub Bot commented on DRILL-7168:
---

arina-ielchiieva commented on pull request #1850: DRILL-7168: Implement ALTER 
SCHEMA ADD / REMOVE commands
URL: https://github.com/apache/drill/pull/1850
 
 
   Jira - [DRILL-7168](https://issues.apache.org/jira/browse/DRILL-7168).
 

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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands
> --
>
> Key: DRILL-7168
> URL: https://issues.apache.org/jira/browse/DRILL-7168
> Project: Apache Drill
>  Issue Type: Sub-task
>Reporter: Arina Ielchiieva
>Assignee: Arina Ielchiieva
>Priority: Major
>  Labels: doc-impacting
> Fix For: 1.17.0
>
>
> By [~Paul.Rogers]:
> {quote}
> Sooner or later users are going to ask for a command to update just the 
> properties, or just add or remove a column, without having to spell out the 
> entire new schema. ALTER TABLE SCHEMA ADD/REMOVE COLUMN/PROPERTY ...
> {quote}
> Syntax:
> {code:sql}
> alter schema  
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> add [or replace]
> [columns (col1 int, col2 varchar)]
> [properties ('prop1'='val1', 'prop2'='val2')]
> {code}
> Add command will fail if column or property with the same name exists, unless 
> OR REPLACE keywords are indicated.
> Add command will fail, if schema file does not exit.
> {code:sql}
> alter schema
> (for table dfs.tmp.nation | path '/tmp/schema.json')
> remove
> [columns (`col1`, `col2`)]
> [properties ('prop1', 'prop2')]
> {code}
> Remove command won't fail if column or property does not exist but will fail 
> if schema file is absent.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)