You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Thierry Boileau (JIRA)" <ji...@apache.org> on 2012/11/30 18:43:59 UTC

[jira] [Created] (CASSANDRA-5008) "show schema" command in cassandra-cli generates wrong "index_options" values.

Thierry Boileau created CASSANDRA-5008:
------------------------------------------

             Summary: "show schema" command in cassandra-cli generates wrong "index_options" values.
                 Key: CASSANDRA-5008
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5008
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 1.1.6
         Environment: ubuntu 12.04
            Reporter: Thierry Boileau


Using cassandra-cli, launch the "show schema" command and save the output to a file.
Try to import it in order to recreate the schema, it fails with error message :
"Syntax error at position 626: no viable alternative at input '}'"



--
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-5008) "show schema" command in cassandra-cli generates wrong "index_options" values.

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

Thierry Boileau edited comment on CASSANDRA-5008 at 11/30/12 5:46 PM:
----------------------------------------------------------------------

After some investigations, it appears that the "index_options" attributes are badly generated when there is actually no index options :

create column family Test
  with column_type = 'Standard'
  and comparator = 'UTF8Type'
  and default_validation_class = 'UTF8Type'
  and key_validation_class = 'UTF8Type'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
    {column_name : 'email',
    validation_class : UTF8Type,
    index_name : 'test_email',
    index_type : 0,
    index_options : {

}},
    {column_name : 'enabled',
    validation_class : UTF8Type,
    index_name : 'test_enabled',
    index_type : 0,
    index_options : {

}},
    {column_name : 'roles',
    validation_class : UTF8Type,
    index_name : 'test_roles',
    index_type : 0,
    index_options : {

}}]
                
      was (Author: thboileau):
    After some investigations, it appears that the "index_options" attributes are badly generated when there is actually no index options :

create column family Test
  with column_type = 'Standard'
  and comparator = 'UTF8Type'
  and default_validation_class = 'UTF8Type'
  and key_validation_class = 'UTF8Type'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
    {column_name : 'email',
    validation_class : UTF8Type,
    index_name : 'test_email',
    index_type : 0,
    index_options : {
}},
    {column_name : 'enabled',
    validation_class : UTF8Type,
    index_name : 'test_enabled',
    index_type : 0,
    index_options : {
}},
    {column_name : 'roles',
    validation_class : UTF8Type,
    index_name : 'test_roles',
    index_type : 0,
    index_options : {
}}]
                  
> "show schema" command in cassandra-cli generates wrong "index_options" values.
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5008
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5008
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: ubuntu 12.04
>            Reporter: Thierry Boileau
>
> Using cassandra-cli, launch the "show schema" command and save the output to a file.
> Try to import it in order to recreate the schema, it fails with error message :
> "Syntax error at position 626: no viable alternative at input '}'"

--
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-5008) "show schema" command in cassandra-cli generates wrong "index_options" values.

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

Thierry Boileau edited comment on CASSANDRA-5008 at 11/30/12 5:47 PM:
----------------------------------------------------------------------

After some investigations, it appears that the "index_options" attributes are badly generated when there is actually no index options :

create column family Test
  with column_type = 'Standard'
  and comparator = 'UTF8Type'
  and default_validation_class = 'UTF8Type'
  and key_validation_class = 'UTF8Type'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
    {column_name : 'email',
    validation_class : UTF8Type,
    index_name : 'test_email',
    index_type : 0,
    index_options : {

}},
    {column_name : 'enabled',
    validation_class : UTF8Type,
    index_name : 'test_enabled',
    index_type : 0,
    index_options : {

}},
    {column_name : 'roles',
    validation_class : UTF8Type,
    index_name : 'test_roles',
    index_type : 0,
    index_options : {

}}]

When removing these empty "index_options" attributes, the script is correctly handled.
                
      was (Author: thboileau):
    After some investigations, it appears that the "index_options" attributes are badly generated when there is actually no index options :

create column family Test
  with column_type = 'Standard'
  and comparator = 'UTF8Type'
  and default_validation_class = 'UTF8Type'
  and key_validation_class = 'UTF8Type'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
    {column_name : 'email',
    validation_class : UTF8Type,
    index_name : 'test_email',
    index_type : 0,
    index_options : {

}},
    {column_name : 'enabled',
    validation_class : UTF8Type,
    index_name : 'test_enabled',
    index_type : 0,
    index_options : {

}},
    {column_name : 'roles',
    validation_class : UTF8Type,
    index_name : 'test_roles',
    index_type : 0,
    index_options : {

}}]
                  
> "show schema" command in cassandra-cli generates wrong "index_options" values.
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5008
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5008
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: ubuntu 12.04
>            Reporter: Thierry Boileau
>
> Using cassandra-cli, launch the "show schema" command and save the output to a file.
> Try to import it in order to recreate the schema, it fails with error message :
> "Syntax error at position 626: no viable alternative at input '}'"

--
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] [Updated] (CASSANDRA-5008) "show schema" command in cassandra-cli generates wrong "index_options" values.

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

Jonathan Ellis updated CASSANDRA-5008:
--------------------------------------

         Reviewer: brandon.williams
         Priority: Minor  (was: Major)
    Fix Version/s: 1.1.8
         Assignee: Yuki Morishita
    
> "show schema" command in cassandra-cli generates wrong "index_options" values.
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5008
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5008
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: ubuntu 12.04
>            Reporter: Thierry Boileau
>            Assignee: Yuki Morishita
>            Priority: Minor
>             Fix For: 1.1.8
>
>
> Using cassandra-cli, launch the "show schema" command and save the output to a file.
> Try to import it in order to recreate the schema, it fails with error message :
> "Syntax error at position 626: no viable alternative at input '}'"

--
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-5008) "show schema" command in cassandra-cli generates wrong "index_options" values.

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

Thierry Boileau commented on CASSANDRA-5008:
--------------------------------------------

I guess the fix is located in method "showColumnMeta" of class "org.apache.cassandra.cli.CliClient". It could be something like this:

if (colDef.index_options != null && !colDef.index_options.entrySet().isEmpty())
            {
                sb.append(TAB + TAB + "index_options : {"+NEWLINE);        
                for (Map.Entry<String, String> entry : colDef.index_options.entrySet())
                {
                    sb.append(TAB + TAB + TAB + CliUtils.escapeSQLString(entry.getKey()) + ": '" + CliUtils.escapeSQLString(entry.getValue()) + "'," + NEWLINE);
                }
                sb.append("}");
            }
                
> "show schema" command in cassandra-cli generates wrong "index_options" values.
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5008
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5008
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: ubuntu 12.04
>            Reporter: Thierry Boileau
>
> Using cassandra-cli, launch the "show schema" command and save the output to a file.
> Try to import it in order to recreate the schema, it fails with error message :
> "Syntax error at position 626: no viable alternative at input '}'"

--
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-5008) "show schema" command in cassandra-cli generates wrong "index_options" values.

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

Thierry Boileau commented on CASSANDRA-5008:
--------------------------------------------

After some investigations, it appears that the "index_options" attributes are badly generated when there is actually no index options :

create column family Test
  with column_type = 'Standard'
  and comparator = 'UTF8Type'
  and default_validation_class = 'UTF8Type'
  and key_validation_class = 'UTF8Type'
  and read_repair_chance = 0.1
  and dclocal_read_repair_chance = 0.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
  and caching = 'KEYS_ONLY'
  and column_metadata = [
    {column_name : 'email',
    validation_class : UTF8Type,
    index_name : 'test_email',
    index_type : 0,
    index_options : {
}},
    {column_name : 'enabled',
    validation_class : UTF8Type,
    index_name : 'test_enabled',
    index_type : 0,
    index_options : {
}},
    {column_name : 'roles',
    validation_class : UTF8Type,
    index_name : 'test_roles',
    index_type : 0,
    index_options : {
}}]
                
> "show schema" command in cassandra-cli generates wrong "index_options" values.
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-5008
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5008
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: ubuntu 12.04
>            Reporter: Thierry Boileau
>
> Using cassandra-cli, launch the "show schema" command and save the output to a file.
> Try to import it in order to recreate the schema, it fails with error message :
> "Syntax error at position 626: no viable alternative at input '}'"

--
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