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

Arina Ielchiieva updated DRILL-7168:
------------------------------------
    Description: 
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.

  was:
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}

{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, will return 
false status only.


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

Reply via email to