[ 
https://issues.apache.org/jira/browse/CASSANDRA-14486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

C. Scott Andreas updated CASSANDRA-14486:
-----------------------------------------
    Component/s: Tools

> Can't dump a compact table with 'null' in a clustering column using 
> sstabledump
> -------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-14486
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14486
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Vladimir Krivopalov
>            Priority: Major
>
> The following compact table is perfectly valid because of backward 
> compatibility:
>  cqlsh:test> CREATE TABLE cf (pk int, ck1 int, ck2 int, rc int, primary key 
> (pk, ck1, ck2)) WITH COMPACT STORAGE;
>  cqlsh:test> INSERT INTO cf (pk, ck1, rc) VALUES (1, 1, 1);
>  cqlsh:test> SELECT * FROM cf;
>  
>   pk | ck1 | ck2  | rc
>   ----+-----+------+----
>     1 |   1 | null |  1
>   
>    (1 rows)
> But sstabledump fails to output it:
> osboxes@osboxes:/tmp$ sstabledump -t 
> /var/lib/cassandra/data/test/cf-f12ca9e0650811e8bd2e599ed57bc695/mc-1-big-Data.db
>  
> [
>   {
>     "partition" : {
>       "key" : [ "1" ],
>       "position" : 0
>     },
>     "rows" : [
>       {
>         "type" : "row",
>         "position" : 32,
>         "clustering" : [ 1 ] } ] } ]Exception in thread "main" 
> java.lang.NullPointerException
>       at 
> org.apache.cassandra.serializers.Int32Serializer.deserialize(Int32Serializer.java:31)
>       at 
> org.apache.cassandra.serializers.Int32Serializer.deserialize(Int32Serializer.java:25)
>       at 
> org.apache.cassandra.db.marshal.Int32Type.toJSONString(Int32Type.java:101)
>       at 
> org.apache.cassandra.tools.JsonTransformer.serializeClustering(JsonTransformer.java:347)
>       at 
> org.apache.cassandra.tools.JsonTransformer.serializeRow(JsonTransformer.java:244)
>       at 
> org.apache.cassandra.tools.JsonTransformer.serializePartition(JsonTransformer.java:211)
>       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:101)
>       at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:240)
> The problem seems to be that JsonTransformer doesn't expect 'null' values for 
> a clustering key of a row.
>  



--
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

Reply via email to