目前,我有一张拥有10K行记录的表格,其中包含以下主键。
PRIMARY KEY ((deviceid, time), channelname)
我需要得到:
PRIMARY KEY (deviceid, time, channelname)
我看过一些资料,说要重新建立整个表。你有什么方法或建议可以将我的行导出并导入到新表中吗?
谢谢;)
aploetz@cqlsh:presentation> COPY shipcrewregistry (shipname , lastname , firstname ,
citizenid , aliases) TO '/home/aploetz/shipcrewreg_20150805.txt'
WITH HEADER=true AND DELIMITER='|';
9 rows exported in 0.026 seconds.
一旦我删除并重新创建表格,想要导入数据的话,可以使用COPY FROM
命令:
aploetz@cqlsh:presentation> COPY shipcrewregistry (shipname , lastname , firstname ,
citizenid , aliases) FROM '/home/aploetz/shipcrewreg_20150805.txt'
WITH HEADER=true AND DELIMITER='|';
9 rows imported in 0.636 seconds.
如果您想了解COPY更多的信息,请查看DataStax文档。