Re: sstable2json2sstable bug with json data stored
On 6/15/11 17:41, Timo Nentwig wrote: (json can likely be boiled down even more...) Any JSON (well, probably anything with quotes...) breaks it: { 74657374: [[data, {foo:bar}, 1308209845388000]] } [default@foo] set transactions[test][data]='{foo:bar}'; I feared that storing data in a readable fashion would be a fateful idea. https://issues.apache.org/jira/browse/CASSANDRA-2780
Re: sstable2json2sstable bug with json data stored
The JSON you are showing below is an export from cassandra? { 74657374: [[data, {foo:bar}, 1308209845388000]] } Does this work? { 74657374: [[data, {foo:bar}, 1308209845388000]] } -sd On Thu, Jun 16, 2011 at 9:49 AM, Timo Nentwig timo.nent...@toptarif.de wrote: On 6/15/11 17:41, Timo Nentwig wrote: (json can likely be boiled down even more...) Any JSON (well, probably anything with quotes...) breaks it: { 74657374: [[data, {foo:bar}, 1308209845388000]] } [default@foo] set transactions[test][data]='{foo:bar}'; I feared that storing data in a readable fashion would be a fateful idea. https://issues.apache.org/jira/browse/CASSANDRA-2780
Re: sstable2json2sstable bug with json data stored
On 6/16/11 10:06, Sasha Dolgy wrote: The JSON you are showing below is an export from cassandra? Yes. Just posted the solution: https://issues.apache.org/jira/browse/CASSANDRA-2780?focusedCommentId=13050274page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13050274 Guess this could simply be done in the quote() method. { 74657374: [[data, {foo:bar}, 1308209845388000]] } Does this work? { 74657374: [[data, {foo:bar}, 1308209845388000]] } -sd On Thu, Jun 16, 2011 at 9:49 AM, Timo Nentwigtimo.nent...@toptarif.de wrote: On 6/15/11 17:41, Timo Nentwig wrote: (json can likely be boiled down even more...) Any JSON (well, probably anything with quotes...) breaks it: { 74657374: [[data, {foo:bar}, 1308209845388000]] } [default@foo] set transactions[test][data]='{foo:bar}'; I feared that storing data in a readable fashion would be a fateful idea. https://issues.apache.org/jira/browse/CASSANDRA-2780
Re: sstable2json2sstable bug with json data stored
On 6/16/11 10:12, Timo Nentwig wrote: On 6/16/11 10:06, Sasha Dolgy wrote: The JSON you are showing below is an export from cassandra? Yes. Just posted the solution: https://issues.apache.org/jira/browse/CASSANDRA-2780?focusedCommentId=13050274page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13050274 Guess this could simply be done in the quote() method. Hm, is this the way it's supposed to be? [default@foo] set transactions[test][data]='{foo:bar}'; Value inserted. [default@foo] get transactions[test][data]; = (column=data, value={foo:bar}, timestamp=1308214517443000) [default@foo] set transactions[test][data]='{\foo\:bar}'; Value inserted. [default@foo] get transactions[test][data]; = (column=data, value={foo:bar}, timestamp=1308214532484000) Otherwise here's a regex that cares about existing backslashes: private static String quote(final String val) { return String.format(\%s\, val.replaceAll((?!)\, \\\)); } { 74657374: [[data, {foo:bar}, 1308209845388000]] } Does this work? { 74657374: [[data, {foo:bar}, 1308209845388000]] } -sd On Thu, Jun 16, 2011 at 9:49 AM, Timo Nentwigtimo.nent...@toptarif.de wrote: On 6/15/11 17:41, Timo Nentwig wrote: (json can likely be boiled down even more...) Any JSON (well, probably anything with quotes...) breaks it: { 74657374: [[data, {foo:bar}, 1308209845388000]] } [default@foo] set transactions[test][data]='{foo:bar}'; I feared that storing data in a readable fashion would be a fateful idea. https://issues.apache.org/jira/browse/CASSANDRA-2780
sstable2json2sstable bug with json data stored
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 }]; ;