[ https://issues.apache.org/jira/browse/CASSANDRA-14199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16344218#comment-16344218 ]
Simon Zhou commented on CASSANDRA-14199: ---------------------------------------- I pushed a fix for 3.0 [here|https://github.com/szhou1234/cassandra/commit/1a8fff02e93e0acb90e785fdca7f30d9aae54b1a] and will provide fixes for newer versions. [~cnlwsu] could you help review this? For your convenience, this is how the output looks like after the fix: {code} [ { "partition" : { "key" : [ "id" ], "position" : 0 }, "rows" : [ { "type" : "row", "position" : 181, "liveness_info" : { "tstamp" : "2018-01-29T22:58:49.111820Z" }, "cells" : [ { "name" : "c2", "frozen" : true, "values" : [ "3", "4" ] }, { "name" : "c4", "frozen" : true, "values" : [ "over", "view" ] }, { "name" : "c6", "frozen" : true, "values" : { "driver" : "java", "note" : "new" } }, { "name" : "c1", "deletion_info" : { "marked_deleted" : "2018-01-29T22:58:49.111819Z", "local_delete_time" : "2018-01-29T22:58:49Z" } }, { "name" : "c1", "path" : [ "f7b01890-0547-11e8-817b-adb40ecebcf5" ] }, { "name" : "c1", "path" : [ "f7b01891-0547-11e8-817b-adb40ecebcf5" ] }, { "name" : "c3", "deletion_info" : { "marked_deleted" : "2018-01-29T22:58:49.111819Z", "local_delete_time" : "2018-01-29T22:58:49Z" } }, { "name" : "c3", "path" : [ "set" ] }, { "name" : "c3", "path" : [ "user" ] }, { "name" : "c5", "deletion_info" : { "marked_deleted" : "2018-01-29T22:58:49.111819Z", "local_delete_time" : "2018-01-29T22:58:49Z" } }, { "name" : "c5", "path" : [ "good" ] }, { "name" : "c5", "path" : [ "root" ] } ] } ] } ] {code} Two changes: - I added field "frozen" for frozen collections. - The elements in the frozen collection will be in one line (other than one line per each element in un-frozen collection), to better indicate that they are immutable. There could be another independent issue that, for un-frozen collection, there is always one output line for "deletion_info", even the cell doesn't have any deletion. Anyway there should be a separate fix if it's an issue. > exception when dumping sstable with frozen collection of UUID > ------------------------------------------------------------- > > Key: CASSANDRA-14199 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14199 > Project: Cassandra > Issue Type: Bug > Components: Tools > Reporter: Simon Zhou > Assignee: Simon Zhou > Priority: Major > Fix For: 3.0.x > > > When dumping (sstabledump) sstable with frozen collection of UUID, there is > exception like this: > {code:java} > Exception in thread "main" org.apache.cassandra.serializers.MarshalException: > UUID should be 16 or 0 bytes (24) > at > org.apache.cassandra.serializers.UUIDSerializer.validate(UUIDSerializer.java:43) > at > org.apache.cassandra.db.marshal.AbstractType.getString(AbstractType.java:128) > at > org.apache.cassandra.tools.JsonTransformer.serializeCell(JsonTransformer.java:440) > at > org.apache.cassandra.tools.JsonTransformer.serializeColumnData(JsonTransformer.java:374) > at > org.apache.cassandra.tools.JsonTransformer.serializeRow(JsonTransformer.java:278) > at > org.apache.cassandra.tools.JsonTransformer.serializePartition(JsonTransformer.java:213) > at > java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) > at > java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) > at java.util.Iterator.forEachRemaining(Iterator.java:116) > at > java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) > at > java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) > at > java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) > at > java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) > at > java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) > at > java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) > at > java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) > at > org.apache.cassandra.tools.JsonTransformer.toJson(JsonTransformer.java:102) > at > org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:242){code} > > *Steps to reproduce:* > {code:java} > cqlsh> create TABLE stresscql.sstabledump_test(userid text PRIMARY KEY, c1 > list<uuid>, c2 frozen<list<uuid>>, c3 set<text>, c4 frozen<set<text>>, c5 > map<text,text>, c6 frozen<map<text,text>>); > cqlsh> insert INTO stresscql.sstabledump_test (userid, c1, c2, c3, c4, c5, > c6) VALUES ( 'id', [6947e8c0-02fa-11e8-87e1-fb0d0e20b5c4], > [6947e8c0-02fa-11e8-87e1-fb0d0e20b5c4], {'set', 'user'}, {'view', 'over'}, > {'good': 'hello', 'root': 'text'}, {'driver': 'java', 'note': 'new'});{code} > > *Root cause:* > Frozen collection is treated as simple column and it's the client's > responsibility to parse the data from ByteBuffer. We have this logic in > different drivers but sstabledump doesn't have the logic in place. It just > treat the whole collection as a single UUID. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org