cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hseu (JIRA)" <>
Subject [jira] Created: (CASSANDRA-643) NullPointerException when calling get_range_slice()
Date Fri, 18 Dec 2009 09:54:18 GMT
NullPointerException when calling get_range_slice()

                 Key: CASSANDRA-643
             Project: Cassandra
          Issue Type: Bug
          Components: Core
    Affects Versions: 0.5
         Environment: Linux
            Reporter: Jonathan Hseu

This bug affects 0.5.0beta2.

In the SlicePredicate struct, column_names is defined as "optional", and so can be null.

get_range_slice() passes the "predicate.getColumn_names()" to "ThriftValidation.validateColumns()"
without first checking if it's null, resulting in the following exception:

	at org.apache.cassandra.service.ThriftValidation.validateColumns(
	at org.apache.cassandra.service.ThriftValidation.validateColumns(
	at org.apache.cassandra.service.CassandraServer.get_range_slice(
	at org.apache.cassandra.service.Cassandra$Processor$get_range_slice.process(
	at org.apache.cassandra.service.Cassandra$Processor.process(
	at org.apache.thrift.server.TThreadPoolServer$
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$

Strangely enough, calling it from python doesn't generate this exception, but calling it from
C++ does, with the following code:
shared_ptr<TTransport> transport(new TSocket(host, port));
shared_ptr<TProtocol> proto(new TBinaryProtocol(transport));
CassandraClient client(proto);

ColumnParent column_parent;
column_parent.column_family = "Test";
SlicePredicate slice_predicate;

std::vector<KeySlice> keys;
client.get_range_slice(keys, keyspace, column_parent, slice_predicate, "", "", 100, ONE);

The fix is trivial, just check that predicate.getColumn_names() is not null in line 562 of

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message