You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Rahul Bhardwaj <ra...@indiamart.com> on 2015/01/12 09:22:47 UTC

how dump a query result into csv file

Hi All,

I want to dump a query result into a csv file with custom column delimiter.
Please help.



Regards:
Rahul Bhardwaj

-- 

Follow IndiaMART.com <http://www.indiamart.com> for latest updates on this 
and more: <https://plus.google.com/+indiamart> 
<https://www.facebook.com/IndiaMART> <https://twitter.com/IndiaMART> Mobile 
Channel: 
<https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=668561641&mt=8> 
<https://play.google.com/store/apps/details?id=com.indiamart.m> 
<http://m.indiamart.com/>
<https://www.youtube.com/watch?v=DzORNbeSXN8&list=PL2o4J51MqpL0mbue6kzDa6eymLVUXtlR1&index=2>
Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam 
Yahin Banta Hai <https://www.youtube.com/watch?v=hmS4Afl2bNU>!!!

Re: how dump a query result into csv file

Posted by Rahul Bhardwaj <ra...@indiamart.com>.
sry consider these stats:

nodetool cfstats clickstream.business_feed_new
Keyspace: clickstream
        Read Count: 2108
        Read Latency: 8.148092030360532 ms.
        Write Count: 923452
        Write Latency: 2.8382575358545976 ms.
        Pending Flushes: 0
                Table: business_feed_new
                SSTable count: 15
                Space used (live): 446908108
                Space used (total): 446908108
                Space used by snapshots (total): 0
                SSTable Compression Ratio: 0.21311411274805014
                Memtable cell count: 249458
                Memtable data size: 14938837
                Memtable switch count: 37
                Local read count: 2108
                Local read latency: 8.149 ms
                Local write count: 923452
                Local write latency: 2.839 ms
                Pending flushes: 0
                Bloom filter false positives: 0
                Bloom filter false ratio: 0.00000
                Bloom filter space used: 560
                Compacted partition minimum bytes: 18
                Compacted partition maximum bytes: 557074610
                Compacted partition mean bytes: 102846983
                Average live cells per slice (last five minutes):
93.25047438330171
                Maximum live cells per slice (last five minutes): 102.0
                Average tombstones per slice (last five minutes): 0.0
                Maximum tombstones per slice (last five minutes): 0.0


On Mon, Jan 12, 2015 at 4:07 PM, Rahul Bhardwaj <
rahul.bhardwaj@indiamart.com> wrote:

> Hi,
>
> Thanks for your quick reply.
>
> But I know this command , but for one table which has around 10lacs rows,
> this command (Copy table_name to 'table_name.csv' ) get stuck for long time
> also slows down my cluster.
>
> pfb table stats:
>
> nodetool cfstats clickstream.business_feed
> Keyspace: clickstream
>         Read Count: 20
>         Read Latency: 0.35955000000000004 ms.
>         Write Count: 282
>         Write Latency: 12.891524822695036 ms.
>         Pending Flushes: 0
>                 Table: business_feed
>                 SSTable count: 2
>                 Space used (live): 25745467
>                 Space used (total): 25745467
>                 Space used by snapshots (total): 0
>                 SSTable Compression Ratio: 0.20019757349631778
>                 Memtable cell count: 183396
>                 Memtable data size: 10983652
>                 Memtable switch count: 2
>                 Local read count: 20
>                 Local read latency: 0.360 ms
>                 Local write count: 282
>                 Local write latency: 12.892 ms
>                 Pending flushes: 0
>                 Bloom filter false positives: 0
>                 Bloom filter false ratio: 0.00000
>                 Bloom filter space used: 32
>                 Compacted partition minimum bytes: 52066355
>                 Compacted partition maximum bytes: 74975550
>                 Compacted partition mean bytes: 68727587
>                 Average live cells per slice (last five minutes): 1.25
>                 Maximum live cells per slice (last five minutes): 2.0
>                 Average tombstones per slice (last five minutes): 0.0
>                 Maximum tombstones per slice (last five minutes): 0.0
>
>
> Please help in finding the cause.
>
>
> Regards:
> Rahul Bhardwaj
>
> On Mon, Jan 12, 2015 at 3:05 PM, Andreas Finke <Andreas.Finke@solvians.com
> > wrote:
>
>>  I think this might be what you are looking for
>>
>>
>> http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/copy_r.html
>>
>>  Andi
>>  ------------------------------
>> *From:* Rahul Bhardwaj [rahul.bhardwaj@indiamart.com]
>> *Sent:* 12 January 2015 09:22
>> *To:* user
>> *Subject:* how dump a query result into csv file
>>
>>   Hi All,
>>
>>  I want to dump a query result into a csv file with custom column
>> delimiter.
>> Please help.
>>
>>
>>
>>  Regards:
>> Rahul Bhardwaj
>>
>>
>> Follow IndiaMART.com <http://www.indiamart.com> for latest updates on
>> this and more:  <https://plus.google.com/+indiamart>
>> <https://www.facebook.com/IndiaMART> <https://twitter.com/IndiaMART>
>> Mobile Channel:
>> <https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=668561641&mt=8>
>> <https://play.google.com/store/apps/details?id=com.indiamart.m>
>> <http://m.indiamart.com/>
>>
>> <https://www.youtube.com/watch?v=DzORNbeSXN8&list=PL2o4J51MqpL0mbue6kzDa6eymLVUXtlR1&index=2>
>> Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam
>> Yahin Banta Hai <https://www.youtube.com/watch?v=hmS4Afl2bNU>!!!
>>
>
>

-- 

Follow IndiaMART.com <http://www.indiamart.com> for latest updates on this 
and more: <https://plus.google.com/+indiamart> 
<https://www.facebook.com/IndiaMART> <https://twitter.com/IndiaMART> Mobile 
Channel: 
<https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=668561641&mt=8> 
<https://play.google.com/store/apps/details?id=com.indiamart.m> 
<http://m.indiamart.com/>
<https://www.youtube.com/watch?v=DzORNbeSXN8&list=PL2o4J51MqpL0mbue6kzDa6eymLVUXtlR1&index=2>
Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam 
Yahin Banta Hai <https://www.youtube.com/watch?v=hmS4Afl2bNU>!!!

Re: how dump a query result into csv file

Posted by Rahul Bhardwaj <ra...@indiamart.com>.
Hi,

Thanks for your quick reply.

But I know this command , but for one table which has around 10lacs rows,
this command (Copy table_name to 'table_name.csv' ) get stuck for long time
also slows down my cluster.

pfb table stats:

nodetool cfstats clickstream.business_feed
Keyspace: clickstream
        Read Count: 20
        Read Latency: 0.35955000000000004 ms.
        Write Count: 282
        Write Latency: 12.891524822695036 ms.
        Pending Flushes: 0
                Table: business_feed
                SSTable count: 2
                Space used (live): 25745467
                Space used (total): 25745467
                Space used by snapshots (total): 0
                SSTable Compression Ratio: 0.20019757349631778
                Memtable cell count: 183396
                Memtable data size: 10983652
                Memtable switch count: 2
                Local read count: 20
                Local read latency: 0.360 ms
                Local write count: 282
                Local write latency: 12.892 ms
                Pending flushes: 0
                Bloom filter false positives: 0
                Bloom filter false ratio: 0.00000
                Bloom filter space used: 32
                Compacted partition minimum bytes: 52066355
                Compacted partition maximum bytes: 74975550
                Compacted partition mean bytes: 68727587
                Average live cells per slice (last five minutes): 1.25
                Maximum live cells per slice (last five minutes): 2.0
                Average tombstones per slice (last five minutes): 0.0
                Maximum tombstones per slice (last five minutes): 0.0


Please help in finding the cause.


Regards:
Rahul Bhardwaj

On Mon, Jan 12, 2015 at 3:05 PM, Andreas Finke <An...@solvians.com>
wrote:

>  I think this might be what you are looking for
>
>
> http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/copy_r.html
>
>  Andi
>  ------------------------------
> *From:* Rahul Bhardwaj [rahul.bhardwaj@indiamart.com]
> *Sent:* 12 January 2015 09:22
> *To:* user
> *Subject:* how dump a query result into csv file
>
>   Hi All,
>
>  I want to dump a query result into a csv file with custom column
> delimiter.
> Please help.
>
>
>
>  Regards:
> Rahul Bhardwaj
>
>
> Follow IndiaMART.com <http://www.indiamart.com> for latest updates on
> this and more:  <https://plus.google.com/+indiamart>
> <https://www.facebook.com/IndiaMART> <https://twitter.com/IndiaMART>
> Mobile Channel:
> <https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=668561641&mt=8>
> <https://play.google.com/store/apps/details?id=com.indiamart.m>
> <http://m.indiamart.com/>
>
> <https://www.youtube.com/watch?v=DzORNbeSXN8&list=PL2o4J51MqpL0mbue6kzDa6eymLVUXtlR1&index=2>
> Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam
> Yahin Banta Hai <https://www.youtube.com/watch?v=hmS4Afl2bNU>!!!
>

-- 

Follow IndiaMART.com <http://www.indiamart.com> for latest updates on this 
and more: <https://plus.google.com/+indiamart> 
<https://www.facebook.com/IndiaMART> <https://twitter.com/IndiaMART> Mobile 
Channel: 
<https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=668561641&mt=8> 
<https://play.google.com/store/apps/details?id=com.indiamart.m> 
<http://m.indiamart.com/>
<https://www.youtube.com/watch?v=DzORNbeSXN8&list=PL2o4J51MqpL0mbue6kzDa6eymLVUXtlR1&index=2>
Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam 
Yahin Banta Hai <https://www.youtube.com/watch?v=hmS4Afl2bNU>!!!

RE: how dump a query result into csv file

Posted by Andreas Finke <An...@solvians.com>.
I think this might be what you are looking for

http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/copy_r.html

Andi
________________________________
From: Rahul Bhardwaj [rahul.bhardwaj@indiamart.com]
Sent: 12 January 2015 09:22
To: user
Subject: how dump a query result into csv file

Hi All,

I want to dump a query result into a csv file with custom column delimiter.
Please help.



Regards:
Rahul Bhardwaj


Follow IndiaMART.com<http://www.indiamart.com> for latest updates on this and more: [http://www.indiamart.com/newsletters/mailer/images/google-plus-icon.jpg] <https://plus.google.com/+indiamart>  [http://www.indiamart.com/newsletters/mailer/images/facebk-icon.jpg] <https://www.facebook.com/IndiaMART>  [http://www.indiamart.com/newsletters/mailer/images/twitter-icon.jpg] <https://twitter.com/IndiaMART>  Mobile Channel: [http://www.indiamart.com/newsletters/mailer/images/apple.png] <https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=668561641&mt=8>  [http://www.indiamart.com/newsletters/mailer/images/gplay.gif] <https://play.google.com/store/apps/details?id=com.indiamart.m>  [http://www.indiamart.com/newsletters/mailer/images/mapp.gif] <http://m.indiamart.com/>
<https://www.youtube.com/watch?v=DzORNbeSXN8&list=PL2o4J51MqpL0mbue6kzDa6eymLVUXtlR1&index=2>
Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam Yahin Banta Hai<https://www.youtube.com/watch?v=hmS4Afl2bNU>!!!