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 <marc...@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:administra...@ctlab.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@cassandra.apache.org
> For additional commands, e-mail: user-h...@cassandra.apache.org
> 

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

Reply via email to