在 cassandra 中将一张表复制到另一张表 [英] copy one table to another in cassandra

查看:52
本文介绍了在 cassandra 中将一张表复制到另一张表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将数据从标准事件复制到标准事件临时..下面我正在做的步骤

i want to copy data from standardevents to standardeventstemp.. below steps i am doing

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';

但我在第三步后出现以下错误

but i am getting below error after 3rd step

错误请求:无效的 STRING 常量 (3a1ccec0-ef77-11e3-9e56-22000ae3163a)uuid 类型的名称

在第 0 列中止导入,之前插入的值仍然存在.

谁能解释这个错误的原因,我该如何解决这个问题

can anybody explain the cause of this error and how can i resolve this

uuid 的数据类型为 uuid 其余数据类型为 varchar

datatype of uuid is uuid the rest of the datatypes are varchar

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'};

推荐答案

原来这是一个已知错误 Cassandra 1.2.2.

It turned out that this is a known bug in Cassandra 1.2.2.

相同的命令在 2.0.x 中运行良好,因此升级将解决问题.

The same commands work fine in 2.0.x, so an upgrade will fix the problem.

这篇关于在 cassandra 中将一张表复制到另一张表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆