Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-13891

fromJson(null) throws java.lang.NullPointerException on Cassandra

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Severity:
      Low

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              eribeiro Edward Ribeiro Assign to me
              Reporter:
              marcel@lisemarie.com Marcel Villet
              Authors:
              Edward Ribeiro
              Reviewers:
              Jason Brown

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment