[jira] [Comment Edited] (CASSANDRA-13891) fromJson(null) throws java.lang.NullPointerException on Cassandra

2018-04-04 Thread Edward Ribeiro (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-13891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16425891#comment-16425891
 ] 

Edward Ribeiro edited comment on CASSANDRA-13891 at 4/4/18 5:25 PM:


[~jasobrown], the second test I created below fails with 
NullPointerException, but everything passes after the little fix. FYI, 
the test that fails on 2.2 and 3.0 is below:


{code:java}
execute("INSERT INTO %s (k, frozenmapval) VALUES (?, fromJson(?))", 0, null);
assertRows(execute("SELECT k, frozenmapval FROM %s WHERE k = ?", 0), row(0, 
null));{code}
 

I have open the following PRs targeting 2.2 and 3.0, respectively. I don't have 
access to a CI so it would be nice if you could run those tests. :)

[https://github.com/apache/cassandra/pull/215] 

[https://github.com/apache/cassandra/pull/216]

Oh, and let me know if I missed something, please. 

Thanks!


was (Author: eribeiro):
[~jasobrown], the second test I created below fails with 
\{{NullPointerException}}, but everything passes after the little fix. I have 
open the following PRs targeting 2.2 and 3.0, respectively. I don't have access 
to a CI so it would be nice if you could run those tests. :)

[https://github.com/apache/cassandra/pull/215] 

[https://github.com/apache/cassandra/pull/216]

Oh, and let me know if I missed something, please. 

Thanks!

> 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
>Assignee: Edward Ribeiro
>Priority: Minor
> Fix For: 4.0, 3.11.3
>
> Attachments: CASSANDRA-13891.patch
>
>
> 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:
> {code:java}
> create type type1
> (
> id int,
> name text
> );
> create table table1
> (
> id int,
> t FROZEN,
> primary key (id)
> );{code}
> 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
(v7.6.3#76005)

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



[jira] [Comment Edited] (CASSANDRA-13891) fromJson(null) throws java.lang.NullPointerException on Cassandra

2018-04-03 Thread Edward Ribeiro (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-13891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16424283#comment-16424283
 ] 

Edward Ribeiro edited comment on CASSANDRA-13891 at 4/3/18 4:59 PM:


Hey, [~jasobrown], thank you very much. I was going to do this today, but you 
beat me to it. :) Thanks again and sorry for taking too long to look again at 
this issue.

PS: fyi, the first incarnation of this patch was adressed to trunk, but I was 
asked to port it to 2.2 first. 

 

Cheers!


was (Author: eribeiro):
Hey, [~jasobrown], thank you very much. I was going to do this today, but you 
beat me. :) Thanks again.

PS: fyi, the first incarnation of this patch was adressed to trunk, but I was 
asked to port it to 2.2 first. 

 

Cheers!

> 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
>Assignee: Edward Ribeiro
>Priority: Minor
> Fix For: 4.0, 3.11.3
>
> Attachments: CASSANDRA-13891.patch
>
>
> 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:
> {code:java}
> create type type1
> (
> id int,
> name text
> );
> create table table1
> (
> id int,
> t FROZEN,
> primary key (id)
> );{code}
> 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
(v7.6.3#76005)

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



[jira] [Comment Edited] (CASSANDRA-13891) fromJson(null) throws java.lang.NullPointerException on Cassandra

2018-01-26 Thread Edward Ribeiro (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-13891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16341664#comment-16341664
 ] 

Edward Ribeiro edited comment on CASSANDRA-13891 at 1/26/18 10:06 PM:
--

Hi [~blerer],

Thanks for taking your time to look at this patch.

I have setup a 2.2 patched branch: 
[https://github.com/eribeiro/cassandra/tree/13891-2.2]

I have never used CircleCI before (the project is using this to build and test 
C* right?), so I am lost about how to build and run the CI on my 2.2 patched 
branch.

I have created a CircleCI account via Github authentication, but it looks like 
it tries to build a only master and even so it spews an error message. Could 
you point me at links where I can find how to solve those issues?

PS: Running {{JsonTest}} on both cassandra-2.2 and 13891-2.2 branches: it threw 
some errors I didn't see when the patch was 3.9+

 

Thanks again! 


was (Author: eribeiro):
Hi [~blerer],

Thanks for taking your time to look at this patch.

I have setup a 2.2 patched branch: 
[https://github.com/eribeiro/cassandra/tree/13891-2.2]

I have never used CircleCI before (the project is using this to build and test 
C* right?), so I am lost about how to build and run the CI on my 2.2 patched 
branch.

I have created a CircleCI account via Github authentication, but it looks like 
it tries to build a only master and even so it spews an error message. Could 
you point me at links where I can find how to solve those issues?

PS: Running \{{JsonTest}} on both cassandra-2.2 and 13891-2.2 branches threw 
some errors I didn't see when the patch was 3.9+

 

Thanks again! 

> 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
>Assignee: Edward Ribeiro
>Priority: Minor
> Attachments: CASSANDRA-13891.patch
>
>
> 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:
> {code:java}
> create type type1
> (
> id int,
> name text
> );
> create table table1
> (
> id int,
> t FROZEN,
> primary key (id)
> );{code}
> 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
(v7.6.3#76005)

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