Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-7662

Implement templated CREATE TABLE functionality (CREATE TABLE LIKE)

    XMLWordPrintableJSON

Details

    • Normal

    Description

      Implement templated CREATE TABLE functionality (CREATE TABLE LIKE) to simplify creating new tables duplicating existing ones (see parent_table part of http://www.postgresql.org/docs/9.1/static/sql-createtable.html).

      CREATE TABLE <new_table> LIKE <old_table>; - would create a new table with the same columns and options as <old_table>

      Additional info for newcomers:

      In order to implement this change you will need to change the Parser.g ANTLR file located in the src/antlr directory and the java classes corresponding to the CREATE statement located in the org.apache.cassandra.cql3.statements.schema package.
      The unit test for the CQL logic are located under org.apache.cassandra.cql3.validation
      cqlsh parsing will need to be modified to support the new LIKE syntax. The logic is in pylib/cqlshlib/cql3handling.py and the test in pylib/cqlshlib/test/test_cqlsh_completion.py

      Attachments

        1. 7662.patch
          48 kB
          Pramod Nair
        2. CASSANDRA-7662.patch
          10 kB
          Pramod Nair

        Issue Links

          Activity

            People

              maxwellguo Maxwell Guo
              aleksey Aleksey Yeschenko
              Maxwell Guo
              Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated: