Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
By Paul.Rogers:
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 ...
Syntax:
alter schema (for table dfs.tmp.nation | path '/tmp/schema.json') add [or replace] [columns (col1 int, col2 varchar)] [properties ('prop1'='val1', 'prop2'='val2')]
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.
alter schema (for table dfs.tmp.nation | path '/tmp/schema.json') remove [columns (`col1`, `col2`)] [properties ('prop1', 'prop2')]
Remove command won't fail if column or property does not exist but will fail if schema file is absent.
Attachments
Issue Links
- links to