cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Evans <eev...@rackspace.com>
Subject Re: import data into cassandra
Date Wed, 24 Feb 2010 19:44:10 GMT
On Wed, 2010-02-24 at 18:43 +0100, Martin Probst wrote:
> host:/opt/cassandra# bin/json2sstable -K Keyspace1 -c
> col1 ../utf8_cassandra.json data/Keyspace1/col1-2-Data.db 
> Exception in thread "main" java.lang.NumberFormatException: For input
> string: "PR"
>         at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>         at java.lang.Integer.parseInt(Integer.java:447)
>         at
> org.apache.cassandra.utils.FBUtilities.hexToBytes(FBUtilities.java:255)
>         at
> org.apache.cassandra.tools.SSTableImport.addToStandardCF(SSTableImport.java:89)
>         at
> org.apache.cassandra.tools.SSTableImport.importJson(SSTableImport.java:156)
>         at
> org.apache.cassandra.tools.SSTableImport.main(SSTableImport.java:207) 
> 
> The Keyspace is configured as follows:
>    <Keyspace Name="Keyspace1">
>       <ColumnFamily CompareWith="UTF8Type" Name="col1" Comment="some
> data"/>
>     </Keyspace>

This is because hex strings are used to represent byte arrays in the
JSON format, (i.e. the string 'PR' would be turned into something like
'5052').

> Is there another way to import some data, maybe a tool or something?
> I've used the latest stable cassandra version (0.5.0).

As Jonathan stated, you're best bet is to tackle this using the Thrift
interface first.

-- 
Eric Evans
eevans@rackspace.com


Mime
View raw message