Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-14199

exception when dumping sstable with frozen collection of UUID

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: 3.0.x
    • Component/s: Legacy/Tools
    • Labels:
      None
    • Severity:
      Normal

      Description

      When dumping (sstabledump) sstable with frozen collection of UUID, there is exception like this:

      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)

       

      Steps to reproduce:

      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'});

       

      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.

        Attachments

          Activity

            People

            • Assignee:
              szhou Simon Zhou
              Reporter:
              szhou Simon Zhou
              Authors:
              Simon Zhou
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: