2

I have a table

CREATE TABLE logs (
transaction_id text,
timestamp timeuuid,
action text,
event text
)

which I have to copy to a csv at the end of the day. Timestamp needs to be converted into a human readable time format. Is it possible to do it with the copy command using cqlsh. I'm using

cqlsh>Copy logs (transaction_id,timestamp,action,event)  to '/tmp/logs.csv' with datetimeformat='%m/%d/%Y'

but this doesn't convert the timeuuid to %m/%d/%y.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Arslan Mehboob
  • 1,012
  • 1
  • 9
  • 21
  • 2
    Date time format only work for timestamp and date – Ashraful Islam Jul 18 '17 at 11:40
  • 1
    Unfortunately, `COPY` is not going to work for you here. You might want to try writing your own exporter that SELECTs the `logs` data using `dateof(timestamp)` and then you can format it however you like. – Aaron Jul 18 '17 at 17:08

0 Answers0