You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jose Martinez Poblete (JIRA)" <ji...@apache.org> on 2015/09/26 16:54:04 UTC

[jira] [Created] (CASSANDRA-10401) json2sstable fails with NPE

Jose Martinez Poblete created CASSANDRA-10401:
-------------------------------------------------

             Summary: json2sstable fails with NPE
                 Key: CASSANDRA-10401
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10401
             Project: Cassandra
          Issue Type: Bug
          Components: Tools
         Environment: Cassandra 2.1.8.621
            Reporter: Jose Martinez Poblete


We have the following table...

{noformat}
CREATE TABLE elp.document (
    business_area_ct text,
    business_id text,
    document_id text,
    access_level_ct text,
    annotation_tx text,
    author_nm text,
    business_id_type_ct text,
    cms_id text,
    direction_ct text,
    document_code_id uuid,
    file_metadata_map_nm map<frozen<format_version>, frozen<load_data>>,
    last_mod_ts timestamp,
    last_mod_user_id text,
    official_document_ts timestamp,
    repository_logical_package_no int,
    repository_offset_no int,
    repository_package_handle_user_id text,
    repository_package_nm text,
    repository_package_sequence_no int,
    repository_procedural_nm text,
    review_complete_in boolean,
    source_system_document_id text,
    source_system_nm text,
    status_cd text,
    vendor_nm text,
    PRIMARY KEY ((business_area_ct, business_id), document_id)
) WITH CLUSTERING ORDER BY (document_id ASC)
{noformat}

And the following  json in a file created from sstable2json tool

{noformat}
[
{"key": "This is business_area_ct:This is business_id",
 "cells": [["This is document_id:","",1443217787319002],
           ["This is document_id:author_nm","This is autor_nm",1443217787319002]]}
]
{noformat}

Let's say we deleted that record form the DB and wanted to bring it back
If we try to create an sstable from this json file,  get a NPE 

{noformat}
-bash-4.1$ json2sstable -K elp -c document-3264cbe063c211e5bc34e746786b7b29 test2.json  /var/lib/cassandra/data/elp/document-3264cbe063c211e5bc34e746786b7b29/elp-document-ka-1-Data.db
Importing 1 keys...
java.lang.NullPointerException
	at org.apache.cassandra.tools.SSTableImport.getKeyValidator(SSTableImport.java:442)
	at org.apache.cassandra.tools.SSTableImport.importUnsorted(SSTableImport.java:316)
	at org.apache.cassandra.tools.SSTableImport.importJson(SSTableImport.java:287)
	at org.apache.cassandra.tools.SSTableImport.main(SSTableImport.java:514)
ERROR: null
-bash-4.1$
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)