-1

i am using below commands for coping data

COPY events.standardevents (uuid, data, name, time, tracker, type, userid) TO 'temp.csv'; 

truncate standardevents;

COPY event.standardeventstemp (uuid, data, name, time, tracker, type, userid) FROM 'temp.csv';

i tried above things in two different ways

one table which contains one fiend as uuid and one without uuid..

without uuid above things are working fine but with uuid it is not working..

Can somebody please tell how can i resolve this problem?

getting an error:

Bad Request: Invalid STRING constant (3a1ccec0-ef77-11e3-9e56-22000ae3163a) for name of type uuid

aborting import at column #0, previously inserted values are still present.

CREATE TABLE standardevents (
  uuid uuid PRIMARY KEY,
  data text,
  name text,
  time text,
  tracker text,
  type text,
  userid text
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};
Helping Hand..
  • 2,430
  • 4
  • 32
  • 52
  • 1
    Are you getting an error message? – Aaron Jun 12 '14 at 14:13
  • edited my question.. please refer the again. – Helping Hand.. Jun 13 '14 at 08:43
  • Did you also mean to `truncate standardeventstemp` before reading back from CSV? If you don't, that could explain the error about uuid being a duplicate. – BrianC Jun 14 '14 at 18:40
  • @BrianC actually in my local system once i tried to copy then truncate the table and then try to copy back from the csv file but still it was showing uuid duplicate error, and after truncating i check the data in that particular table and it was empty onlly, so that i am getting confused and don't want to take any such risk with server data. so can you please tell me how can i resolve this thing. – Helping Hand.. Jun 16 '14 at 10:25
  • again i edited question. checked it again. – Helping Hand.. Jun 16 '14 at 10:44
  • @WorkingHard.. here's the part I'm confused about: in your steps above you export from standardevents, truncate standardevents, then import back into standardeventstemp. This 'temp' table is different and was not truncated. That could be causing your duplicate uuid problem. – BrianC Jun 16 '14 at 22:18
  • i am getting confused.. can you tell me which steps i have to follow, i want to copy data from standardevents to standardeventstemp.. because their is no data in standardeventstemp it is empty only... May be i am doing something wrong, can you tells me the steps which i have to follow for achieving the above? – Helping Hand.. Jun 18 '14 at 12:31

1 Answers1

0

You asked this question twice, and it was already answered here:

copy one table to another in cassandra

Community
  • 1
  • 1