You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jeremy Hanna (JIRA)" <ji...@apache.org> on 2011/02/22 21:31:38 UTC

[jira] Created: (CASSANDRA-2221) 'show create' commands on the CLI to export schema

'show create' commands on the CLI to export schema
--------------------------------------------------

                 Key: CASSANDRA-2221
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
             Project: Cassandra
          Issue Type: Improvement
          Components: Tools
            Reporter: Jeremy Hanna
            Priority: Trivial


It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.

A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.

Another use case is for testing purposes - you want to replicate a problem.

We currently have schematool for import/export but that is deprecated and it exports into yaml.

This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Morton updated CASSANDRA-2221:
------------------------------------

    Attachment: 0001-change-show-keyspace-to-create-cli-script.patch

Attached patch 0001 is for 0.7 and modifies the show keyspace statement to create a cli script. 

The previous statement was "show keyspaces" changed to "show keyspace <keyspace>?" (dropped the s) to match "describe keyspace <keyspace>?"

Also bug fix to unescape the default validation clause.  

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-change-show-keyspace-to-create-cli-script.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2221:
--------------------------------------

    Reviewer: xedin

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Morton updated CASSANDRA-2221:
------------------------------------

    Attachment: 0001-add-show-schema-statement-v08-2.patch

rebased for v0.8 as 0001-add-show-schema-statement-v08-2.patch

Let me know if you want it for 0.7

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.2
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement-v08-2.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "David Boxenhorn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039601#comment-13039601 ] 

David Boxenhorn commented on CASSANDRA-2221:
--------------------------------------------

This looks a lot like the use case that I was trying to solve with CASSANDRA-2636 (I didn't know about this ticket), except for one thing: I want to either create a new cluster or update an old one (i.e. propagate *changes* from dev). I could manually substitute "update" for "create", but I would prefer a solution that doesn't require human intervention. How about, "recreate", which will create the CF if it doesn't exist, otherwise update it? 

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Assigned: (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis reassigned CASSANDRA-2221:
-----------------------------------------

    Assignee: Aaron Morton  (was: Jeremy Hanna)

Aaron, if you want to take a look at this it's related to the yaml-removal from CASSANDRA-2007.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.7.4
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Morton updated CASSANDRA-2221:
------------------------------------

    Attachment: 0001-add-show-schema-statement-8.patch
                0001-add-show-schema-statement.patch

Updated patches for 07 and 08.

- show keyspaces returned to normal
- added show schema <keyspace>?;

Sample from 0.8

{noformat}

[default@Keyspace1] show schema Keyspace1;
create keyspace Keyspace1
  with placement_strategy = 'SimpleStrategy'
  and strategy_options = [{replication_factor : 1}];

use Keyspace1;

create column family Counter1
  with column_type = 'Standard'
  and comparator = 'BytesType'
  and default_validation_class = 'CounterColumnType'
  and key_validation_class = 'BytesType'
  and memtable_operations = 0.29062499999999997
  and memtable_throughput = 62
  and memtable_flush_after = 1440
  and rows_cached = 0.0
  and row_cache_save_period = 0
  and keys_cached = 200000.0
  and key_cache_save_period = 14400
  and read_repair_chance = 1.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = false
  and row_cache_provider = 'ConcurrentLinkedHashCacheProvider';
{noformat}

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "David Boxenhorn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039750#comment-13039750 ] 

David Boxenhorn commented on CASSANDRA-2221:
--------------------------------------------

That's a very minimal amount of diffing, whether the CF exists or not! 

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039742#comment-13039742 ] 

Jonathan Ellis commented on CASSANDRA-2221:
-------------------------------------------

bq. Why schema diffing?

""recreate", which will create the CF if it doesn't exist, otherwise update it" implicitly requires diffing.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Morton updated CASSANDRA-2221:
------------------------------------

    Attachment:     (was: 0001-change-show-keyspace-to-create-cli-script.patch)

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jon Hermes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005343#comment-13005343 ] 

Jon Hermes commented on CASSANDRA-2221:
---------------------------------------

CASSANDRA-1906 completes the YAML removal (all that's left is with on-boot yaml load of per-node settings, which is fine as is).

Tying this right next to the 'show keyspaces;' logic (maybe 'export keyspaces;') is going to be the easiest, as it already iterates through your settings. 

Instead of showing shorthand ("  default_validation_class: BytesType"), show longhand ("with default_validation_class=BytesType ") and cascade them into a "create column family ... " output.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.7.4
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004196#comment-13004196 ] 

Aaron Morton commented on CASSANDRA-2221:
-----------------------------------------

Sounds reasonable, will take a look. 


> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.7.4
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jeremy Hanna (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13081175#comment-13081175 ] 

Jeremy Hanna commented on CASSANDRA-2221:
-----------------------------------------

Any update on this?  It's been "patch available" for a while and would be nice to have committed.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.4
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement-v08-2.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2221:
--------------------------------------

         Priority: Minor  (was: Trivial)
    Fix Version/s: 0.7.3
         Assignee: Jeremy Hanna

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Jeremy Hanna
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.7.3
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Morton updated CASSANDRA-2221:
------------------------------------

    Attachment:     (was: 0001-change-show-keyspace-to-create-cli-script-v0.8.patch)

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-change-show-keyspace-to-create-cli-script.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039716#comment-13039716 ] 

Jonathan Ellis commented on CASSANDRA-2221:
-------------------------------------------

Schema diffing is out of scope here.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "David Boxenhorn (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039738#comment-13039738 ] 

David Boxenhorn commented on CASSANDRA-2221:
--------------------------------------------

Why schema diffing? I want to get all the attributes of all the CFs, so I an port them to another cluster. 

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039752#comment-13039752 ] 

Jonathan Ellis commented on CASSANDRA-2221:
-------------------------------------------

True.

Still, adding new CLI commands is out of scope here.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-2221:
---------------------------------------

    Attachment: CASSANDRA-2221-v2-rebased.patch

I don't know why I didn't get a notification about this, it's confusing :/ Patch looks ok (+1), I'm adding version of v2 rebased with latest cassandra-0.8 branch. Brandon will commit it shortly.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.4
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement-v08-2.patch, 0001-add-show-schema-statement.patch, CASSANDRA-2221-v2-rebased.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Morton updated CASSANDRA-2221:
------------------------------------

    Attachment: 0001-change-show-keyspace-to-create-cli-script-v0.8.patch

I created the attached 0001-change...v0.8 patch before I saw Jonathans last comment. It's like the 0.7 one but rebased against the 0.8 branch and includes the additional 0.8 attributes, and updates the 0.8 help. 

Also adds unescaping of the value for row cache provider.  

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-change-show-keyspace-to-create-cli-script-v0.8.patch, 0001-change-show-keyspace-to-create-cli-script.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049120#comment-13049120 ] 

Pavel Yaskevich commented on CASSANDRA-2221:
--------------------------------------------

needs rebase, tried to apply on cassandra-0.8 branch (1e77d805fb893515db6a6ab625297ac17412fb45 latest commit). 

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13024801#comment-13024801 ] 

Jonathan Ellis commented on CASSANDRA-2221:
-------------------------------------------

It's still valuable to support this from CLI since (a) this gives us an upgrade path for 0.7 to 0.8 and (b) CQL isn't going to support all the options for 0.8.0 (notably counters).

I'd like to introduce a new command though instead of changing an existing one in a stable release. "show schema" maybe?

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.1
>
>         Attachments: 0001-change-show-keyspace-to-create-cli-script-v0.8.patch, 0001-change-show-keyspace-to-create-cli-script.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13081248#comment-13081248 ] 

Hudson commented on CASSANDRA-2221:
-----------------------------------

Integrated in Cassandra-0.8 #261 (See [https://builds.apache.org/job/Cassandra-0.8/261/])
    Add 'show creates' commands to the cli to export schema.
Patch by Aaron Morton, reviewed by xedin for CASSANDRA-2221

brandonwilliams : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1155100
Files : 
* /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliClient.java
* /cassandra/branches/cassandra-0.8/src/resources/org/apache/cassandra/cli/CliHelp.yaml
* /cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/cli/CliTest.java
* /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliCompleter.java
* /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/Cli.g


> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.8.4
>
>         Attachments: 0001-add-show-schema-statement-8.patch, 0001-add-show-schema-statement-v08-2.patch, 0001-add-show-schema-statement.patch, CASSANDRA-2221-v2-rebased.patch
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Aaron Morton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011074#comment-13011074 ] 

Aaron Morton commented on CASSANDRA-2221:
-----------------------------------------

Do we need this in 0.7.5 or only 0.8 ? There have been some small changes to the CLI script in 0.8 wrt specifying the RF. 

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.7.5
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011081#comment-13011081 ] 

Jonathan Ellis commented on CASSANDRA-2221:
-------------------------------------------

It's more of a nice-to-have in 0.7.5 since we have yaml import/export there.

Definitely don't need to make 0.8 try to read 0.7.5 files (the nice thing about human-readable is you can make people tweak things if they absolutely positively need to do that -- in this case the sane thing to do would just be re-export from 0.8 since the system table itself is compatible).

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.7.5
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2221) 'show create' commands on the CLI to export schema

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13021274#comment-13021274 ] 

Jonathan Ellis commented on CASSANDRA-2221:
-------------------------------------------

at this point is probably best to target CQL-style schema.

> 'show create' commands on the CLI to export schema
> --------------------------------------------------
>
>                 Key: CASSANDRA-2221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Tools
>            Reporter: Jeremy Hanna
>            Assignee: Aaron Morton
>            Priority: Minor
>              Labels: cli
>             Fix For: 0.7.5
>
>
> It would be nice to have 'show create' type of commands on the command-line so that it would generate the DDL for the schema.
> A scenario that would make this useful is where a team works out a data model over time with a dev cluster.  They want to use parts of that schema for new clusters that they create, like a staging/prod cluster.  It would be very handy in this scenario to have some sort of export mechanism.
> Another use case is for testing purposes - you want to replicate a problem.
> We currently have schematool for import/export but that is deprecated and it exports into yaml.
> This new feature would just be able to 'show' - or export if they want the entire keyspace - into a script or commands that could be used in a cli script.  It would need to be able to regenerate everything about the keyspace including indexes and metadata.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira