cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Jirsa <jji...@gmail.com>
Subject Re: fromJson(null) throws java.lang.NullPointerException on Cassandra 3.11
Date Thu, 21 Sep 2017 15:57:30 GMT
It’s a bug. Should file a JIRA if one doesn’t already exist.

-- 
Jeff Jirsa


> On Sep 21, 2017, at 8:16 AM, Marcel Villet <marcelv@ctlab.com> wrote:
> 
> 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?
> 
> Regards
> Marcel
> 
> 
> 
> 
> 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 manager:administrator@ctlab.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: user-help@cassandra.apache.org
> 

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


Mime
View raw message