cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Martinez Poblete (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-10401) json2sstable fails with NPE
Date Fri, 02 Oct 2015 15:48:26 GMT

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

Jose Martinez Poblete commented on CASSANDRA-10401:
---------------------------------------------------

[~mambocab]
I tested as per your suggestions on Cassandra 2.1.9.791 and that seemed to work - THANK YOU!

{noformat}
-bash-4.1$ ls -la /mnt/ephemeral/cassandra/data/t20041/jira_10401-3572e1b0691111e5b05ce73685229767/t20041-jira_10401-ka-1-Data.db
ls: cannot access /mnt/ephemeral/cassandra/data/t20041/jira_10401-3572e1b0691111e5b05ce73685229767/t20041-jira_10401-ka-1-Data.db:
No such file or directory
-bash-4.1$ json2sstable -K t20041 -c jira_10401 /tmp/t20041-jira_10401-ka-1-Data.json /mnt/ephemeral/cassandra/data/t20041/jira_10401-3572e1b0691111e5b05ce73685229767/t20041-jira_10401-ka-1-Data.db
Importing 1 keys...
1 keys imported successfully.
-bash-4.1$ nodetool refresh t20041 jira_10401
-bash-4.1$ cqlsh -k t20041
Connected to DSE_4.8.0 at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.9.791 | DSE 4.8.0 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh:t20041> select * from jira_10401 ;

 col1         | col2         | col3         | col4
--------------+--------------+--------------+--------------
 This is col1 | This is col2 | This is col3 | This is col4

(1 rows)
cqlsh:t20041> exit;
-bash-4.1$ 
{noformat}

> 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 keyspace_name.table_name (
>     col1 text,
>     col2 text,
>     col3 text,
>     col4 text,
>     PRIMARY KEY ((col1, col2), col3)
> ) WITH CLUSTERING ORDER BY (col3 ASC)
> {noformat}
> And the following  json in a file created from sstable2json tool
> {noformat}
> [
> {"key": "This is col1:This is col2,
>  "cells": [["This is col3:","",1443217787319002],
>            ["This is col3:"col4","This is col4",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 data in a json file named test_file.json, we
get a NPE 
> {noformat}
> -bash-4.1$ json2sstable -K elp -c table_name-3264cbe063c211e5bc34e746786b7b29 test_file.json
 /var/lib/cassandra/data/keyspace_name/table_name-3264cbe063c211e5bc34e746786b7b29/keyspace_name-table_name-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)

Mime
View raw message