incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timo Nentwig <timo.nent...@toptarif.de>
Subject sstable2json2sstable bug with json data stored
Date Wed, 15 Jun 2011 15:41:54 GMT
Hi!

Couldn't google anybody having yet experienced this, so I do (0.8):

{
   "foo":{
     "foo":{
       "foo":"bar",
       "foo":"bar",
       "foo":"bar",
       "foo":"",
       "foo":"bar",
       "foo":"bar",
       "id":123456
     }  },
   "foo":null
}

(json can likely be boiled down even more...)

[default@foo] set transactions[test][data]='{"foo":{"foo":{"foo":"bar","foo":"bar","foo":"bar","foo":"","foo":"bar","foo":"bar","id":123456}},"foo":null}';

$ ./sstable2json /var/lib/cassandra/data/foo/transactions-g-1-Data.db > /tmp/foo
$ cat /tmp/foo
{
"74657374": [["data", "{"foo":{"foo":{"foo":"bar","foo":"bar","foo":"bar","foo":"","foo":"bar","foo":"bar","id":123456}},"foo":null}",
1308152085301000]]
}

$ ./json2sstable -s -c transactions -K foo /tmp/json /tmp/ss-g-1-Data.db
Counting keys to import, please wait... (NOTE: to skip this use -n <num_keys>)
org.codehaus.jackson.JsonParseException: Unexpected character ('f' (code 102)): was expecting
comma to separate ARRAY entries
  at [Source: /tmp/json; line: 2, column: 27]
	at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:929)
	at org.codehaus.jackson.impl.JsonParserBase._reportError(JsonParserBase.java:632)
	at org.codehaus.jackson.impl.JsonParserBase._reportUnexpectedChar(JsonParserBase.java:565)
	at org.codehaus.jackson.impl.Utf8StreamParser.nextToken(Utf8StreamParser.java:128)
	at org.codehaus.jackson.impl.JsonParserBase.skipChildren(JsonParserBase.java:263)
	at org.apache.cassandra.tools.SSTableImport.importSorted(SSTableImport.java:328)
	at org.apache.cassandra.tools.SSTableImport.importJson(SSTableImport.java:252)
	at org.apache.cassandra.tools.SSTableImport.main(SSTableImport.java:476)
ERROR: Unexpected character ('f' (code 102)): was expecting comma to separate ARRAY entries
  at [Source: /tmp/json; line: 2, column: 27]

create column family transactions
     with comparator = AsciiType
     and key_validation_class = AsciiType
     and default_validation_class = UTF8Type
     and keys_cached = 0
     and rows_cached = 0
     and column_metadata = [{
         column_name : uuid,
         validation_class : LexicalUUIDType,
         index_name : uuid_idx,
         index_type : 0
     }, {
         column_name : session_id,
         validation_class : LexicalUUIDType,
         index_name : session_id_idx,
         index_type : 0
     }, {
         column_name : guid,
         validation_class : LexicalUUIDType,
         index_name : guid_idx,
         index_type : 0
     }, {
         column_name : timestamp,
         validation_class : LongType
     }, {
         column_name : completed,
         validation_class : BytesType
     }, {
         column_name : user_id,
         validation_class : LongType
     }];
;


Mime
View raw message