You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Marcel Villet (JIRA)" <ji...@apache.org> on 2017/09/21 16:16:00 UTC
[jira] [Created] (CASSANDRA-13891) fromJson(null) throws
java.lang.NullPointerException on Cassandra
Marcel Villet created CASSANDRA-13891:
-----------------------------------------
Summary: fromJson(null) throws java.lang.NullPointerException on Cassandra
Key: CASSANDRA-13891
URL: https://issues.apache.org/jira/browse/CASSANDRA-13891
Project: Cassandra
Issue Type: Bug
Components: CQL
Environment: Cassandra 3.11
Reporter: Marcel Villet
Priority: Minor
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 as expected: {{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.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org