cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning Kropp (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-6180) NPE in CqlRecordWriter: Related to AbstractCassandraStorage handling null values
Date Mon, 14 Oct 2013 09:06:42 GMT


Henning Kropp commented on CASSANDRA-6180:

I agree that {{byte[]}} is not semantically equivalent to {{null}}. The representation of
{{null}} in Cassandra seems to me like an issue on it's own.

How about limiting it to {{CqlStorage}} and making it configurable? So the user can deliberately
change the representation of {{null}}/empty values.

At least I can query easily for {{byte[]}} but not for {{null}}.
> CREATE INDEX null_idx ON null_table(null_value);
> DELETE null_value FROM null_table WHERE null_id = 'a';
> SELECT COUNT(*) FROM null_table WHERE null_value = '';
> SELECT * FROM null_table WHERE null_value = null;
Bad Request: Unsupported null value for indexed column null_value

> NPE in CqlRecordWriter: Related to AbstractCassandraStorage handling null values
> --------------------------------------------------------------------------------
>                 Key: CASSANDRA-6180
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>         Environment: Pig, CqlStorage
>            Reporter: Henning Kropp
>         Attachments: null_test.pig, patch.txt, test_null.cql, test_null_data
> I encountered an issue with the {{CqlStorage}} and it's handling of null values. The
{{CqlRecordWriter}} throws an NPE when a value is null. I found a related ticket CASSANDRA-5885
and applied the there stated fix to the {{AbstractCassandraStorage}}.
> Instead of converting {{null}} values to {{ByteBuffer.wrap(new byte[0])}} {{AbstractCassandraStorage}}
returns {{(ByteBuffer)null}}
> This issue can be reproduced with the attached files: {{test_null.cql}}, {{test_null_data}},
> A fix can be found in the attached patch.
> {code}
> java.lang.NullPointerException
> 	at org.apache.cassandra.hadoop.cql3.CqlRecordWriter$
> Caused by: java.lang.NullPointerException
> 	at org.apache.thrift.protocol.TBinaryProtocol.writeBinary(
> 	at org.apache.cassandra.thrift.Cassandra$execute_prepared_cql3_query_args.write(
> 	at org.apache.thrift.TServiceClient.sendBase(
> 	at org.apache.cassandra.thrift.Cassandra$Client.send_execute_prepared_cql3_query(
> 	at org.apache.cassandra.thrift.Cassandra$Client.execute_prepared_cql3_query(
> 	at org.apache.cassandra.hadoop.cql3.CqlRecordWriter$
> {code}

This message was sent by Atlassian JIRA

View raw message