You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Shotaro Kamio (Created) (JIRA)" <ji...@apache.org> on 2012/01/13 11:35:39 UTC
[jira] [Created] (CASSANDRA-3738) sstable2json doesn't work for
secondary index sstable due to partitioner mismatch
sstable2json doesn't work for secondary index sstable due to partitioner mismatch
---------------------------------------------------------------------------------
Key: CASSANDRA-3738
URL: https://issues.apache.org/jira/browse/CASSANDRA-3738
Project: Cassandra
Issue Type: Bug
Affects Versions: 1.0.6
Environment: linux
Reporter: Shotaro Kamio
sstable2json doesn't work for secondary index sstable in 1.0.6 while it worked in version 0.8.x.
$ bin/sstable2json $DATA/data/Keyspace1/users-hc-1-Data.db
{
"1111": [["birth_year","1973",1326450301786000], ["full_name","Patrick Rothfuss",1326450301782000]],
"1020": [["birth_year","1975",1326450301776000], ["full_name","Brandon Sanderson",1326450301716000]]
}
$ bin/sstable2json $DATA/data/Keyspace1/users.users_birth_year_idx-hc-1-Data.db
Exception in thread "main" java.lang.RuntimeException: Cannot open data/Keyspace1/users.users_birth_year_idx-hc-1 because partitioner does not match org.apache.cassandra.dht.RandomPartitioner
at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:145)
at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:123)
at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:118)
at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:360)
at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:373)
at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:431)
I tested with following sample data via cli:
create keyspace Keyspace1;
use Keyspace1;
create column family users with comparator=UTF8Type and
column_metadata=[{column_name: full_name, validation_class: UTF8Type},
{column_name: email, validation_class: UTF8Type},
{column_name: birth_year, validation_class: LongType, index_type: KEYS},
{column_name: state, validation_class: UTF8Type, index_type: KEYS}];
set users[1020][full_name] = 'Brandon Sanderson';
set users[1020][birth_year] = 1975;
set users[1111][full_name] = 'Patrick Rothfuss';
set users[1111][birth_year] = 1973;
get users where birth_year = 1973;
--
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-3738) sstable2json doesn't work for
secondary index sstable due to partitioner mismatch
Posted by "Yuki Morishita (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuki Morishita updated CASSANDRA-3738:
--------------------------------------
Attachment: cassandra-1.0-3738.txt
SSTableExport trying to open secondary index sstable with storage partitioner causes this error.
Patch attached to use correct partitioner when exporting secondary index sstable.
> sstable2json doesn't work for secondary index sstable due to partitioner mismatch
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-3738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3738
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.0.6
> Environment: linux
> Reporter: Shotaro Kamio
> Assignee: Yuki Morishita
> Labels: tools
> Fix For: 1.0.8
>
> Attachments: cassandra-1.0-3738.txt
>
>
> sstable2json doesn't work for secondary index sstable in 1.0.6 while it worked in version 0.8.x.
> $ bin/sstable2json $DATA/data/Keyspace1/users-hc-1-Data.db
> {
> "1111": [["birth_year","1973",1326450301786000], ["full_name","Patrick Rothfuss",1326450301782000]],
> "1020": [["birth_year","1975",1326450301776000], ["full_name","Brandon Sanderson",1326450301716000]]
> }
> $ bin/sstable2json $DATA/data/Keyspace1/users.users_birth_year_idx-hc-1-Data.db
> Exception in thread "main" java.lang.RuntimeException: Cannot open data/Keyspace1/users.users_birth_year_idx-hc-1 because partitioner does not match org.apache.cassandra.dht.RandomPartitioner
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:145)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:123)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:118)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:360)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:373)
> at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:431)
> I tested with following sample data via cli:
> create keyspace Keyspace1;
> use Keyspace1;
> create column family users with comparator=UTF8Type and
> column_metadata=[{column_name: full_name, validation_class: UTF8Type},
> {column_name: email, validation_class: UTF8Type},
> {column_name: birth_year, validation_class: LongType, index_type: KEYS},
> {column_name: state, validation_class: UTF8Type, index_type: KEYS}];
> set users[1020][full_name] = 'Brandon Sanderson';
> set users[1020][birth_year] = 1975;
> set users[1111][full_name] = 'Patrick Rothfuss';
> set users[1111][birth_year] = 1973;
> get users where birth_year = 1973;
--
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-3738) sstable2json doesn't work for
secondary index sstable due to partitioner mismatch
Posted by "Yuki Morishita (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13185689#comment-13185689 ]
Yuki Morishita commented on CASSANDRA-3738:
-------------------------------------------
In what version do you use to create sstable? If that's 1.0.4, secondary index is created in wrong way.(CASSANDRA-3540)
In that case, you have to drop index and rebuild index first.
> sstable2json doesn't work for secondary index sstable due to partitioner mismatch
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-3738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3738
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.0.6
> Environment: linux
> Reporter: Shotaro Kamio
>
> sstable2json doesn't work for secondary index sstable in 1.0.6 while it worked in version 0.8.x.
> $ bin/sstable2json $DATA/data/Keyspace1/users-hc-1-Data.db
> {
> "1111": [["birth_year","1973",1326450301786000], ["full_name","Patrick Rothfuss",1326450301782000]],
> "1020": [["birth_year","1975",1326450301776000], ["full_name","Brandon Sanderson",1326450301716000]]
> }
> $ bin/sstable2json $DATA/data/Keyspace1/users.users_birth_year_idx-hc-1-Data.db
> Exception in thread "main" java.lang.RuntimeException: Cannot open data/Keyspace1/users.users_birth_year_idx-hc-1 because partitioner does not match org.apache.cassandra.dht.RandomPartitioner
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:145)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:123)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:118)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:360)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:373)
> at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:431)
> I tested with following sample data via cli:
> create keyspace Keyspace1;
> use Keyspace1;
> create column family users with comparator=UTF8Type and
> column_metadata=[{column_name: full_name, validation_class: UTF8Type},
> {column_name: email, validation_class: UTF8Type},
> {column_name: birth_year, validation_class: LongType, index_type: KEYS},
> {column_name: state, validation_class: UTF8Type, index_type: KEYS}];
> set users[1020][full_name] = 'Brandon Sanderson';
> set users[1020][birth_year] = 1975;
> set users[1111][full_name] = 'Patrick Rothfuss';
> set users[1111][birth_year] = 1973;
> get users where birth_year = 1973;
--
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-3738) sstable2json doesn't work for
secondary index sstable due to partitioner mismatch
Posted by "Yuki Morishita (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190191#comment-13190191 ]
Yuki Morishita commented on CASSANDRA-3738:
-------------------------------------------
v2 is much better.
I tested with it and worked as expected.
+1.
> sstable2json doesn't work for secondary index sstable due to partitioner mismatch
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-3738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3738
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.0.6
> Environment: linux
> Reporter: Shotaro Kamio
> Assignee: Yuki Morishita
> Labels: tools
> Fix For: 1.0.8
>
> Attachments: 3738-v2.txt, cassandra-1.0-3738.txt
>
>
> sstable2json doesn't work for secondary index sstable in 1.0.6 while it worked in version 0.8.x.
> $ bin/sstable2json $DATA/data/Keyspace1/users-hc-1-Data.db
> {
> "1111": [["birth_year","1973",1326450301786000], ["full_name","Patrick Rothfuss",1326450301782000]],
> "1020": [["birth_year","1975",1326450301776000], ["full_name","Brandon Sanderson",1326450301716000]]
> }
> $ bin/sstable2json $DATA/data/Keyspace1/users.users_birth_year_idx-hc-1-Data.db
> Exception in thread "main" java.lang.RuntimeException: Cannot open data/Keyspace1/users.users_birth_year_idx-hc-1 because partitioner does not match org.apache.cassandra.dht.RandomPartitioner
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:145)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:123)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:118)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:360)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:373)
> at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:431)
> I tested with following sample data via cli:
> create keyspace Keyspace1;
> use Keyspace1;
> create column family users with comparator=UTF8Type and
> column_metadata=[{column_name: full_name, validation_class: UTF8Type},
> {column_name: email, validation_class: UTF8Type},
> {column_name: birth_year, validation_class: LongType, index_type: KEYS},
> {column_name: state, validation_class: UTF8Type, index_type: KEYS}];
> set users[1020][full_name] = 'Brandon Sanderson';
> set users[1020][birth_year] = 1975;
> set users[1111][full_name] = 'Patrick Rothfuss';
> set users[1111][birth_year] = 1973;
> get users where birth_year = 1973;
--
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-3738) sstable2json doesn't work for
secondary index sstable due to partitioner mismatch
Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Ellis updated CASSANDRA-3738:
--------------------------------------
Attachment: 3738-v2.txt
Can we just move that code into SSTR.open so it's fixed for any use and not just SSTableExport? v2 attached w/ that approach.
> sstable2json doesn't work for secondary index sstable due to partitioner mismatch
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-3738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3738
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.0.6
> Environment: linux
> Reporter: Shotaro Kamio
> Assignee: Yuki Morishita
> Labels: tools
> Fix For: 1.0.8
>
> Attachments: 3738-v2.txt, cassandra-1.0-3738.txt
>
>
> sstable2json doesn't work for secondary index sstable in 1.0.6 while it worked in version 0.8.x.
> $ bin/sstable2json $DATA/data/Keyspace1/users-hc-1-Data.db
> {
> "1111": [["birth_year","1973",1326450301786000], ["full_name","Patrick Rothfuss",1326450301782000]],
> "1020": [["birth_year","1975",1326450301776000], ["full_name","Brandon Sanderson",1326450301716000]]
> }
> $ bin/sstable2json $DATA/data/Keyspace1/users.users_birth_year_idx-hc-1-Data.db
> Exception in thread "main" java.lang.RuntimeException: Cannot open data/Keyspace1/users.users_birth_year_idx-hc-1 because partitioner does not match org.apache.cassandra.dht.RandomPartitioner
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:145)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:123)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:118)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:360)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:373)
> at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:431)
> I tested with following sample data via cli:
> create keyspace Keyspace1;
> use Keyspace1;
> create column family users with comparator=UTF8Type and
> column_metadata=[{column_name: full_name, validation_class: UTF8Type},
> {column_name: email, validation_class: UTF8Type},
> {column_name: birth_year, validation_class: LongType, index_type: KEYS},
> {column_name: state, validation_class: UTF8Type, index_type: KEYS}];
> set users[1020][full_name] = 'Brandon Sanderson';
> set users[1020][birth_year] = 1975;
> set users[1111][full_name] = 'Patrick Rothfuss';
> set users[1111][birth_year] = 1973;
> get users where birth_year = 1973;
--
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-3738) sstable2json doesn't work for
secondary index sstable due to partitioner mismatch
Posted by "Shotaro Kamio (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186644#comment-13186644 ]
Shotaro Kamio commented on CASSANDRA-3738:
------------------------------------------
I've tested it with sstable created on 1.0.6.
> sstable2json doesn't work for secondary index sstable due to partitioner mismatch
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-3738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3738
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.0.6
> Environment: linux
> Reporter: Shotaro Kamio
>
> sstable2json doesn't work for secondary index sstable in 1.0.6 while it worked in version 0.8.x.
> $ bin/sstable2json $DATA/data/Keyspace1/users-hc-1-Data.db
> {
> "1111": [["birth_year","1973",1326450301786000], ["full_name","Patrick Rothfuss",1326450301782000]],
> "1020": [["birth_year","1975",1326450301776000], ["full_name","Brandon Sanderson",1326450301716000]]
> }
> $ bin/sstable2json $DATA/data/Keyspace1/users.users_birth_year_idx-hc-1-Data.db
> Exception in thread "main" java.lang.RuntimeException: Cannot open data/Keyspace1/users.users_birth_year_idx-hc-1 because partitioner does not match org.apache.cassandra.dht.RandomPartitioner
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:145)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:123)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:118)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:360)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:373)
> at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:431)
> I tested with following sample data via cli:
> create keyspace Keyspace1;
> use Keyspace1;
> create column family users with comparator=UTF8Type and
> column_metadata=[{column_name: full_name, validation_class: UTF8Type},
> {column_name: email, validation_class: UTF8Type},
> {column_name: birth_year, validation_class: LongType, index_type: KEYS},
> {column_name: state, validation_class: UTF8Type, index_type: KEYS}];
> set users[1020][full_name] = 'Brandon Sanderson';
> set users[1020][birth_year] = 1975;
> set users[1111][full_name] = 'Patrick Rothfuss';
> set users[1111][birth_year] = 1973;
> get users where birth_year = 1973;
--
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] [Assigned] (CASSANDRA-3738) sstable2json doesn't work for
secondary index sstable due to partitioner mismatch
Posted by "Yuki Morishita (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-3738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuki Morishita reassigned CASSANDRA-3738:
-----------------------------------------
Assignee: Yuki Morishita
> sstable2json doesn't work for secondary index sstable due to partitioner mismatch
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-3738
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3738
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.0.6
> Environment: linux
> Reporter: Shotaro Kamio
> Assignee: Yuki Morishita
>
> sstable2json doesn't work for secondary index sstable in 1.0.6 while it worked in version 0.8.x.
> $ bin/sstable2json $DATA/data/Keyspace1/users-hc-1-Data.db
> {
> "1111": [["birth_year","1973",1326450301786000], ["full_name","Patrick Rothfuss",1326450301782000]],
> "1020": [["birth_year","1975",1326450301776000], ["full_name","Brandon Sanderson",1326450301716000]]
> }
> $ bin/sstable2json $DATA/data/Keyspace1/users.users_birth_year_idx-hc-1-Data.db
> Exception in thread "main" java.lang.RuntimeException: Cannot open data/Keyspace1/users.users_birth_year_idx-hc-1 because partitioner does not match org.apache.cassandra.dht.RandomPartitioner
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:145)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:123)
> at org.apache.cassandra.io.sstable.SSTableReader.open(SSTableReader.java:118)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:360)
> at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:373)
> at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:431)
> I tested with following sample data via cli:
> create keyspace Keyspace1;
> use Keyspace1;
> create column family users with comparator=UTF8Type and
> column_metadata=[{column_name: full_name, validation_class: UTF8Type},
> {column_name: email, validation_class: UTF8Type},
> {column_name: birth_year, validation_class: LongType, index_type: KEYS},
> {column_name: state, validation_class: UTF8Type, index_type: KEYS}];
> set users[1020][full_name] = 'Brandon Sanderson';
> set users[1020][birth_year] = 1975;
> set users[1111][full_name] = 'Patrick Rothfuss';
> set users[1111][birth_year] = 1973;
> get users where birth_year = 1973;
--
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