cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo Motta (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-10401) Improve json2sstable error reporting on nonexistent column
Date Tue, 03 Nov 2015 23:49:27 GMT


Paulo Motta commented on CASSANDRA-10401:

bq. Is there a test?

Added [simple test|]
checking for {{IllegalArgumentException}} when invalid ks/cf pair is specified.

bq. The only bike shedding I have is that if ArrayBackedSortedColumns.factory.create() returns
null why not check the output of that instead instead of checking via a different path? Is
this implying that maybe ColumnFamily.Factory should be the the component that throws a more
reasonable exception?

I think it's better to add an explicit check for schema existence before trying to instantiate
an ArrayBackedSortedColumns, which is an internal class that assumes the ks/cf exists (a similar
check is done in other tools).

Tests will be available shortly below:


> Improve json2sstable error reporting on nonexistent column
> ----------------------------------------------------------
>                 Key: CASSANDRA-10401
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>         Environment: Cassandra
>            Reporter: Jose Martinez Poblete
>            Assignee: Paulo Motta
> 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)
> {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
> Importing 1 keys...
> java.lang.NullPointerException
> 	at
> 	at
> 	at
> 	at
> ERROR: null
> -bash-4.1$
> {noformat}

This message was sent by Atlassian JIRA

View raw message