Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6835 Schema Provision using File / Table Function
  3. DRILL-7168

Implement ALTER SCHEMA ADD / REMOVE COLUMN / PROPERTY commands

    XMLWordPrintableJSON

Details

    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

          Activity

            People

              arina Arina Ielchiieva
              arina Arina Ielchiieva
              Vova Vysotskyi Vova Vysotskyi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: