You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Nick Bailey (JIRA)" <ji...@apache.org> on 2012/06/26 21:21:42 UTC

[jira] [Created] (CASSANDRA-4380) CQL3 CF creation bug

Nick Bailey created CASSANDRA-4380:
--------------------------------------

             Summary: CQL3 CF creation bug
                 Key: CASSANDRA-4380
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
             Project: Cassandra
          Issue Type: Bug
            Reporter: Nick Bailey


{noformat}
cqlsh:test> describe columnfamily stats;

CREATE TABLE stats (
  gid blob PRIMARY KEY
) WITH
  comment='' AND
  comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
  read_repair_chance=0.100000 AND
  gc_grace_seconds=864000 AND
  default_validation=blob AND
  min_compaction_threshold=4 AND
  max_compaction_threshold=32 AND
  replicate_on_write='true' AND
  compaction_strategy_class='SizeTieredCompactionStrategy' AND
  compression_parameters:sstable_compression='SnappyCompressor';
{noformat}

I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:

* default_validation
* min_compaction_threshold
* max_compaction_threshold
* comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Jonathan Ellis commented on CASSANDRA-4380:
-------------------------------------------

Doesn't COMPACT STORAGE provide the ability to model thrift/cql2-style tables?
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

paul cannon commented on CASSANDRA-4380:
----------------------------------------

bq. Doesn't COMPACT STORAGE provide the ability to model thrift/cql2-style tables?

It does for some. It probably would in this case. It doesn't for the cases where there are multiple columns with metadata in addition to undefined/wide-row columns.

Maybe that's not a case worth worrying about, though. We could open a new ticket for recreating thrift/cql2-style tables in CQL 3 mode with COMPACT STORAGE and some made-up default column names like "colname" and "value" or something.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Marcos Dione commented on CASSANDRA-4380:
-----------------------------------------

what about the rest of the output? if I run «cqlsh --cqlversion=3», I expect that the output is CQLv3, but for a particular CF that was created with a CQLv2 command, I get:

CREATE TABLE logs (
  day timestamp PRIMARY KEY
) WITH
  comment='' AND
  comparator=text AND
  read_repair_chance=0.100000 AND
  gc_grace_seconds=864000 AND
  default_validation=text AND
  min_compaction_threshold=4 AND
  max_compaction_threshold=32 AND
  replicate_on_write='true' AND
  compaction_strategy_class='SizeTieredCompactionStrategy' AND
  compression_parameters:sstable_compression='SnappyCompressor';

which is only valid in CQLv2; with CQLv3 I get this message:

<stdin>:17:Bad Request: No definition found that is not part of the PRIMARY KEY
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

paul cannon commented on CASSANDRA-4380:
----------------------------------------

Marcos- there isn't any way to recreate some CQL 2 tables in CQL 3. CQL 3 can model the same data, but the structure of the table needs to be different. Cqlsh does the best that it can here, but if you want a better guarantee of valid reconstruction of CQL 2 tables, use cqlsh in CQL 2 mode.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Michael Dyrby Jensen edited comment on CASSANDRA-4380 at 9/20/12 2:59 AM:
--------------------------------------------------------------------------

Using CQL3, how are you now expected to create a column family like:

CREATE TABLE UserProducts
(
  userId uuid PRIMARY KEY
);

Where I would then dynamically add the product ids in the column name for each product, and leaving the column value null for each. The type of the product id is uuid.

When I try to create this column family I am told: No definition found that is not part of the PRIMARY KEY

Any help is greatly appreciated.

It works with CQL2, so is it a bug that CQL3 cannot? 







                
      was (Author: dyrby76):
    Using CQL3, how are you now expected to create a column family like:

CREATE TABLE UserProducts
(
  userId uuid PRIMARY KEY
);

Where I would then dynamically add the product ids in the column name for each product, and leaving the column value null for each. The type of the product id is uuid.

When I try to create this column family I am told: No definition found that is not part of the PRIMARY KEY

Any help is greatly appreciated.









                  
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

paul cannon commented on CASSANDRA-4380:
----------------------------------------

bq. for 1.2, provided you use the system.schema_columnfamilies table, it should (almost) always be possible to create a valid CQL3 definition from an existing CF

Could you elaborate on how that should be done? Say I made the following in CQL2:

{noformat}
CREATE TABLE foo (t text PRIMARY KEY, f float, x uuid) WITH default_validation=timestamp;
{noformat}

If that can be recreated in CQL 3, then I've missed a development somewhere.

bq. The Cassandra already does that (so that you can always access thrift CF from CQL3), see CFDefinition.java. It could be worth using the same made-up names here.

That's good to know. We should probably make that new ticket then.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

paul cannon commented on CASSANDRA-4380:
----------------------------------------

Nick, can you try with the bin/cqlsh from my 4380 branch, here:

https://github.com/thepaul/cassandra/tree/4380

This should fix the cases where cql2-style DESCRIBE was used sometimes, even when the connection was cql3, but looking closer at your case, it might not actually fix that.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Michael Dyrby Jensen commented on CASSANDRA-4380:
-------------------------------------------------

Using CQL3, how are you now expected to create a column family like:

CREATE TABLE UserProducts
(
  userId uuid PRIMARY KEY
);

Where I would then dynamically add the product ids in the column name for each product, and leaving the column value null for each. The type of the product id is uuid.

When I try to create this column family I am told: No definition found that is not part of the PRIMARY KEY

Any help is greatly appreciated.









                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Sylvain Lebresne commented on CASSANDRA-4380:
---------------------------------------------

I'll not that at lest for CQL3, as explained in CASSANDRA-4377, it will be much easier to fix on trunk than on 1.1 because of CASSANDRA-4018. As far as my personal opinion is involved, I would be fine in saying that cqlsh describe command is broken with CQL3 until C* 1.2 (since CQL3 is beta until then anyway).
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Nick Bailey commented on CASSANDRA-4380:
----------------------------------------

My issue was more with the fact that it seems impossible to set any of those four properties on a cf via cql. 
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Jonathan Ellis commented on CASSANDRA-4380:
-------------------------------------------

CREATE TABLE UserProducts (
  user_id uuid,
  product_id uuid,
  PRIMARY KEY (user_id, product_id)
);

More details at http://www.datastax.com/dev/blog/schema-in-cassandra-1-1.

Let's take any further discussion on usage to the mailing list.  Thanks!
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Nick Bailey commented on CASSANDRA-4380:
----------------------------------------

Seems to work fine for me.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Sylvain Lebresne commented on CASSANDRA-4380:
---------------------------------------------

bq. It doesn't for the cases where there are multiple columns with metadata in addition to undefined/wide-row columns

That's true on 1.1 but I'll note that for 1.2, provided you use the system.schema_columnfamilies table, it should (almost) always be possible to create a valid CQL3 definition from an existing CF (potentially, and almost always in the case of CF created from thrift/CQL2, with COMPACT STORAGE). The only thing that comes in mind that makes me say "almost" is the case where people have created on the thrift side a column_metadata on a CompositeType. In that last case we can create a CQL3 query to recreate the CF, but not the column_metadata. I think it's safe to say that we can ignore that.

bq. some made-up default column names

The Cassandra already does that (so that you can always access thrift CF from CQL3), see CFDefinition.java. It could be worth using the same made-up names here.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

paul cannon commented on CASSANDRA-4380:
----------------------------------------

This was actually intended behavior- since it's possible to create tables in cql2 which can't be duplicated in cql3, I wanted to still note the possibly-relevant options on certain tables even if the syntax wasn't valid cql3.

I've since changed my mind, however, since it is confusing and makes it harder to do automated tests on DESCRIBE output, so I've already made this change in a personal branch. I'll put that up here.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

paul cannon updated CASSANDRA-4380:
-----------------------------------

    Affects Version/s: 1.1.0
        Fix Version/s: 1.1.3
    
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Sylvain Lebresne updated CASSANDRA-4380:
----------------------------------------

    Assignee: paul cannon
      Labels: cqlsh  (was: )
     Summary: CQLSH: describe command doesn't output valid CQL command.  (was: CQL3 CF creation bug)
    
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4380) CQLSH: describe command doesn't output valid CQL command.

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

Sylvain Lebresne commented on CASSANDRA-4380:
---------------------------------------------

bq. If that can be recreated in CQL 3, then I've missed a development somewhere

Good point, I think too much in term of CQL3 now I guess, forgot about those. I suppose we could generate a valid CQL3 definition that is "compatible" with that (the same thing without the default_validation_validation part), but it's unclear it's a better idea.
                
> CQLSH: describe command doesn't output valid CQL command.
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-4380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4380
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Nick Bailey
>            Assignee: paul cannon
>              Labels: cqlsh
>             Fix For: 1.1.3
>
>
> {noformat}
> cqlsh:test> describe columnfamily stats;
> CREATE TABLE stats (
>   gid blob PRIMARY KEY
> ) WITH
>   comment='' AND
>   comparator='CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.UTF8Type)' AND
>   read_repair_chance=0.100000 AND
>   gc_grace_seconds=864000 AND
>   default_validation=blob AND
>   min_compaction_threshold=4 AND
>   max_compaction_threshold=32 AND
>   replicate_on_write='true' AND
>   compaction_strategy_class='SizeTieredCompactionStrategy' AND
>   compression_parameters:sstable_compression='SnappyCompressor';
> {noformat}
> I can create a cf in cql3 and then use describe cf to get the above output. However trying to run that create statement says that all of the following are invalid options:
> * default_validation
> * min_compaction_threshold
> * max_compaction_threshold
> * comparator

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira