how dump a query result into csv file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how dump a query result into csv file

Rahul Bhardwaj
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 for latest updates on this and more: Mobile Channel:

Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam Yahin Banta Hai!!!
Reply | Threaded
Open this post in threaded view
|

RE: how dump a query result into csv file

Andreas Finke
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 [[hidden email]]
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 for latest updates on this and more: Mobile Channel:

Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam Yahin Banta Hai!!!
Reply | Threaded
Open this post in threaded view
|

Re: how dump a query result into csv file

Rahul Bhardwaj
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 <[hidden email]> wrote:
I think this might be what you are looking for


Andi

From: Rahul Bhardwaj [[hidden email]]
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 for latest updates on this and more: Mobile Channel:

Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam Yahin Banta Hai!!!



Follow IndiaMART.com for latest updates on this and more: Mobile Channel:

Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam Yahin Banta Hai!!!
Reply | Threaded
Open this post in threaded view
|

Re: how dump a query result into csv file

Rahul Bhardwaj
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 <[hidden email]> 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 <[hidden email]> wrote:
I think this might be what you are looking for


Andi

From: Rahul Bhardwaj [[hidden email]]
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 for latest updates on this and more: Mobile Channel:

Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam Yahin Banta Hai!!!




Follow IndiaMART.com for latest updates on this and more: Mobile Channel:

Watch how Irrfan Khan gets his work done in no time on IndiaMART, kyunki Kaam Yahin Banta Hai!!!