错误从csv复制到cassandra db

时间:2015-12-29 13:09:05

标签: cassandra cassandra-2.0 datastax

我正试图从csv复制到cassandra db,如下所示:

cqlsh:customer_details> copy real_estate (street,city,zip,state) from 'C:\Users\
kiriti.k\Desktop\Sacramentorealestatetransactions.csv' WITH DELIMITER = ';' AND
HEADER = TRUE;

但是收到错误:

Starting copy of customer_details.real_estate with columns ['street', 'city', 'z
ip', 'state'].

Error starting import process:

    Can't pickle <type 'thread.lock'>: it's not found as thread.lock
    can only join a started process
    cqlsh:customer_details> Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Program Files\DataStax Community\python\lib\multiprocessing\forking.p
    y", line 380, in main
        prepare(preparation_data)
      File "C:\Program Files\DataStax Community\python\lib\multiprocessing\forking.p
    y", line 489, in prepare
        file, path_name, etc = imp.find_module(main_name, dirs)
    ImportError: No module named cqlsh

我不知道这个错误意味着什么。我对卡桑德拉家族很新。任何人都已经解决了这类问题。请帮忙。

1 个答案:

答案 0 :(得分:1)

cqlsh是否可以工作,还是仅仅是复制命令问题?我怀疑这与https://issues.apache.org/jira/browse/CASSANDRA-3767有关,除了3767在osx上,自制软件错过了一个依赖项,你正在运行windows。为了解决这个问题,你可以

1)尝试没有python依赖的brian的cassandra-loader

https://github.com/brianmhess/cassandra-loader

2)安装python依赖项,如票证

中所示
  

下载   http://svn.apache.org/repos/asf/cassandra/trunk/pylib/setup.py,和   和cqlshlib来自   http://svn.apache.org/repos/asf/cassandra/trunk/pylib/cqlshlib/,和   然后运行python install setup.py。