cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpan Khandelwal (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-13670) NullPointerException while closing CQLSSTableWriter
Date Wed, 05 Jul 2017 15:02:00 GMT
Arpan Khandelwal created CASSANDRA-13670:
--------------------------------------------

             Summary: NullPointerException while closing CQLSSTableWriter
                 Key: CASSANDRA-13670
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13670
             Project: Cassandra
          Issue Type: Bug
          Components: Tools
         Environment: Linux
            Reporter: Arpan Khandelwal
             Fix For: 3.0.14


Reading data from csv file and writing using CQLSSTableWriter. If I use writer.addRow(); instead
of using writer.rawAddRow() it works fine.

{code:java}
      CQLSSTableWriter.Builder builder = CQLSSTableWriter.builder();
        builder.inDirectory(outputDir).forTable(createDDL).using(insertDML).withPartitioner(new
Murmur3Partitioner());
        CQLSSTableWriter writer = builder.build();
{code}


{code:java}
 try (BufferedReader reader = new BufferedReader(new FileReader(csvFilePath));
            CsvListReader csvReader = new CsvListReader(reader, CsvPreference.STANDARD_PREFERENCE);)
{
        List<String> line;
        while ((line = csvReader.read()) != null) {
            List<ByteBuffer> bbl = new ArrayList<>();
            for (String l : line) {
                bbl.add(ByteBuffer.wrap(l.getBytes()));
            }
            writer.rawAddRow(bbl);
            // If I use writer.addRow(); it works fine.
        }
    } finally {

        writer.close();
    }
{code}


{code:java}
java.lang.RuntimeException: java.lang.NullPointerException
        at org.apache.cassandra.io.sstable.SSTableSimpleUnsortedWriter.close(SSTableSimpleUnsortedWriter.java:136)
        at org.apache.cassandra.io.sstable.CQLSSTableWriter.close(CQLSSTableWriter.java:280)
        at com.cfx.cassandra.SSTableCreator.execute(SSTableCreator.java:155)
        at com.cfx.cassandra.SSTableCreator.main(SSTableCreator.java:84)
    Caused by: java.lang.NullPointerException
        at org.apache.cassandra.io.sstable.format.SSTableReader.saveSummary(SSTableReader.java:910)
        at org.apache.cassandra.io.sstable.format.big.BigTableWriter$IndexWriter.doPrepare(BigTableWriter.java:472)
        at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.prepareToCommit(Transactional.java:173)
        at org.apache.cassandra.io.sstable.format.big.BigTableWriter$TransactionalProxy.doPrepare(BigTableWriter.java:303)
        at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.prepareToCommit(Transactional.java:173)
        at org.apache.cassandra.io.sstable.format.SSTableWriter.prepareToCommit(SSTableWriter.java:229)
        at org.apache.cassandra.io.sstable.SimpleSSTableMultiWriter.prepareToCommit(SimpleSSTableMultiWriter.java:97)
        at org.apache.cassandra.io.sstable.SSTableTxnWriter.doPrepare(SSTableTxnWriter.java:77)
        at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.prepareToCommit(Transactional.java:173)
        at org.apache.cassandra.utils.concurrent.Transactional$AbstractTransactional.finish(Transactional.java:184)
        at org.apache.cassandra.io.sstable.SSTableTxnWriter.finish(SSTableTxnWriter.java:92)
        at org.apache.cassandra.io.sstable.SSTableSimpleUnsortedWriter$DiskWriter.run(SSTableSimpleUnsortedWriter.java:210)
{code}






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message