cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Villet <>
Subject fromJson(null) throws java.lang.NullPointerException on Cassandra 3.11
Date Thu, 21 Sep 2017 15:16:17 GMT
Hi All

Basically, fromJson throws a java.lang.NullPointerException when NULL is passed, instead of
just returning a NULL itself. Say I create a UDT and a table as follows:

create type type1
    id int,
    name text
create table table1
    id int,
    t FROZEN<type1>,
    primary key (id)

And then try and insert a row as such:

insert into table1 (id, t) VALUES (1, fromJson(null));

I get the error: java.lang.NullPointerException

This works:

insert into table1 (id, t) VALUES (1, null);

Programmatically, one does not always know when a UDT will be null, hence me expecting fromJson
to just return null.

Would you agree that this might be a bug?


This email and any files transmitted with it are confidential and intended solely for the
use of the individual or entity to whom they are addressed. If you have received this email
in error please notify the system

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message