You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Aliou SOW <al...@hotmail.com> on 2012/04/11 11:42:52 UTC

INserting data in Cassandra



Hello
all,

We would like to
adopt Cassandra solution
for storing our biological data which
are essentially microarray data.

These data, formatted in text tabulated files, are in the form:



               Sample 1             sample
2             …            sample n

probe 1    value1                  value 2                 …            …





probe
2          

…

probe n



In fact the probes can vary from one chip to another
and you can have chips with more than one million probes,
the samples by cons
vary from one project to another,
the values ​​are floats.

So we would like to represent our column families like they are
formatted in files with the names of the probes (which are unique) as the key,
and the names of the samples as column names and float values as column values
:)

To insert data,
I just created such for example a keyspace testKS
and a column
family testCF but
just by defining the
key (because the column names
vary), then a
file jason for insertion:



{"probe1" :{

                "sample 1":value1(float),

                "sample 2":value2(float),

                …,

                "sample n":value n(float)

},

"probe2" :{

                "sample 1":value1(float),

                "sample 2":value2(float),

                …,

                "sample n":value n(float)

}

}



 

And I used the
tool json2sstable, but that does
not work, I
always have an error:



java.lang.RuntimeException:
Can't write Super columns to the Standard Column Family.



So I have two
questions:

1) What I did
wrong, must I define the complete structure of my column family before
using json2sstable or is it the structure of my json file which is not good?

2) Otherwise what would be the best way
to proceed for insertion based on the data I dispose?



We use Cassandra 1.0.8.
Any help would be welcome.



Thanks.

 		 	   		  

RE: INserting data in Cassandra

Posted by Aliou SOW <al...@hotmail.com>.
Thanks :)

But finally i used Hector and it works fine :D

Date: Wed, 11 Apr 2012 17:19:15 +0200
From: bernarpa@gmail.com
To: user@cassandra.apache.org
Subject: Re: INserting data in Cassandra


  


    
  
  
    On 04/11/12 11:42, Aliou SOW wrote:
    
      
      
        
            And I used
            the
              tool json2sstable, but that does
            not work,
            I
              always have an error:

            

          java.lang.RuntimeException:
Can't
            write Super columns to the Standard Column Family.

            

            So I have
            two
            questions:

            1) What I did
              wrong, must I define the complete structure of my
            column family before
            using json2sstable or is it the structure of my json file
            which is not good?

          
      
    
    I think that you just have to specify column_type = 'super' when
    creating your column family (see
http://stackoverflow.com/questions/6835183/set-super-column-family-in-cassandra-cli)

    

    Paolo

    
 		 	   		  

Re: INserting data in Cassandra

Posted by Paolo Bernardi <be...@gmail.com>.
On 04/11/12 11:42, Aliou SOW wrote:
>
> And I used the tool json2sstable, but that does not work, I always 
> have an error:
>
> java.lang.RuntimeException: Can't write Super columns to the Standard 
> Column Family.
>
> So I have two questions:
> 1) What I did wrong, must I define the complete structure of my column 
> family before using json2sstable or is it the structure of my json 
> file which is not good?
>
I think that you just have to specify column_type = 'super' when 
creating your column family (see 
http://stackoverflow.com/questions/6835183/set-super-column-family-in-cassandra-cli)

Paolo


RE: INserting data in Cassandra

Posted by Aliou SOW <al...@hotmail.com>.
Hello,

Any help Or idea?

Thanks

From: alioujigga@hotmail.com
To: user@cassandra.apache.org
Subject: INserting data in Cassandra
Date: Wed, 11 Apr 2012 09:42:52 +0000









Hello
all,

We would like to
adopt Cassandra solution
for storing our biological data which
are essentially microarray data.

These data, formatted in text tabulated files, are in the form:



               Sample 1             sample
2             …            sample n

probe 1    value1                  value 2                 …            …





probe
2          

…

probe n



In fact the probes can vary from one chip to another
and you can have chips with more than one million probes,
the samples by cons
vary from one project to another,
the values ​​are floats.

So we would like to represent our column families like they are
formatted in files with the names of the probes (which are unique) as the key,
and the names of the samples as column names and float values as column values
:)

To insert data,
I just created such for example a keyspace testKS
and a column
family testCF but
just by defining the
key (because the column names
vary), then a
file jason for insertion:



{"probe1" :{

                "sample 1":value1(float),

                "sample 2":value2(float),

                …,

                "sample n":value n(float)

},

"probe2" :{

                "sample 1":value1(float),

                "sample 2":value2(float),

                …,

                "sample n":value n(float)

}

}



 

And I used the
tool json2sstable, but that does
not work, I
always have an error:



java.lang.RuntimeException:
Can't write Super columns to the Standard Column Family.



So I have two
questions:

1) What I did
wrong, must I define the complete structure of my column family before
using json2sstable or is it the structure of my json file which is not good?

2) Otherwise what would be the best way
to proceed for insertion based on the data I dispose?



We use Cassandra 1.0.8.
Any help would be welcome.



Thanks.