cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Zhou (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-14200) NullPointerException when dumping sstable
Date Tue, 30 Jan 2018 00:56:00 GMT
Simon Zhou created CASSANDRA-14200:
--------------------------------------

             Summary: NullPointerException when dumping sstable
                 Key: CASSANDRA-14200
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14200
             Project: Cassandra
          Issue Type: Bug
            Reporter: Simon Zhou
            Assignee: Simon Zhou
             Fix For: 3.0.x


We have an sstable whose schema has a column of type timestamp and it's not part of primary
key. When dumping the sstable using sstabledump there is NPE like this:
{code:java}
Exception in thread "main" java.lang.NullPointerException
at java.util.Calendar.setTime(Calendar.java:1770)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:943)
at java.text.SimpleDateFormat.format(SimpleDateFormat.java:936)
at java.text.DateFormat.format(DateFormat.java:345)
at org.apache.cassandra.db.marshal.TimestampType.toJSONString(TimestampType.java:93)
at org.apache.cassandra.tools.JsonTransformer.serializeCell(JsonTransformer.java:442)
at org.apache.cassandra.tools.JsonTransformer.serializeColumnData(JsonTransformer.java:376)
at org.apache.cassandra.tools.JsonTransformer.serializeRow(JsonTransformer.java:280)
at org.apache.cassandra.tools.JsonTransformer.serializePartition(JsonTransformer.java:215)
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:104)
at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:242){code}

The reason is that we use a null Date when there is no value for this column:
{code}
    public Date deserialize(ByteBuffer bytes)
    {
        return bytes.remaining() == 0 ? null : new Date(ByteBufferUtil.toLong(bytes));
    }
{code}

It seems that we should not deserialize columns with null values.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message