incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Secondary Index Null Pointer Error
Date Fri, 17 Sep 2010 13:49:44 GMT
Indexed columns don't have to exist.

Try this after I post a fix for
http://issues.apache.org/jira/browse/CASSANDRA-1415.

On Thu, Sep 16, 2010 at 12:53 PM, Colin Britton <colin.britton@gmail.com> wrote:
> Hi,
>
> I am using Casandra 0.7 trunk (r997357) and am having issues with a
> secondary index.
>
> I have a ColumnFamily with a secondary index on column "X". Not every row of
> data has column X. It looks like when I write a row that does not have
> column X, Cassandra throws the following NPE when it writes the index:
>
> ERROR 20:05:37,015 Uncaught exception in thread
> Thread[FLUSH-WRITER-POOL:1,5,main]
> java.util.concurrent.ExecutionException: java.lang.RuntimeException:
> java.lang.NullPointerException
>     at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
>     at java.util.concurrent.FutureTask.get(FutureTask.java:83)
>     at
> org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor.afterExecute(DebuggableThreadPoolExecutor.java:87)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:888)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>     at java.lang.Thread.run(Thread.java:637)
> Caused by: java.lang.RuntimeException: java.lang.NullPointerException
>     at
> org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:34)
>     at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>     ... 2 more
> Caused by: java.lang.NullPointerException
>     at
> org.apache.cassandra.io.sstable.IndexSummary.complete(IndexSummary.java:63)
>     at
> org.apache.cassandra.io.sstable.SSTableWriter$IndexWriter.close(SSTableWriter.java:383)
>     at
> org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:138)
>     at
> org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:132)
>     at
> org.apache.cassandra.db.Memtable.writeSortedContents(Memtable.java:156)
>     at org.apache.cassandra.db.Memtable.access$000(Memtable.java:44)
>     at org.apache.cassandra.db.Memtable$1.runMayThrow(Memtable.java:168)
>     at
> org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30)
>     ... 6 more
>
> This doesn't necessarily happen as soon as the row is written; it happens
> after you write enough rows, or after a restart of the server when the
> commitlog is replayed.
>
> Is it the case that indexed columns must exist?
>
> Thanks
>
> Colin



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

Mime
View raw message