The CQLSH client module object does not have the parse_options attribute

I am trying to access my Cassandra server through a CQLSH client to import a huge CSV file. I get an error module' object has no attribute 'parse_options.

I ran the following command:

cqlsh XXX.XXX.XX.XX XXXX --cqlversion="3.4.2" --execute="copy evolvdso.teste from '2016-10-26 15:25:10.csv' WITH DELIMITER =',' AND HEADER=TRUE --debug";

This is the error and error message:

Starting copy of evolvdso.teste with columns ['ref_equip', 'date', 'load', 'ptd_assoc'].
Traceback (most recent call last):
  File "/usr/local/bin/cqlsh", line 1133, in onecmd
    self.handle_statement(st, statementtext)
  File "/usr/local/bin/cqlsh", line 1170, in handle_statement
    return custom_handler(parsed)
  File "/usr/local/bin/cqlsh", line 1834, in do_copy
    rows = self.perform_csv_import(ks, cf, columns, fname, opts)
  File "/usr/local/bin/cqlsh", line 1846, in perform_csv_import
    csv_options, dialect_options, unrecognized_options = copyutil.parse_options(self, opts)


AttributeError: 'module' object has no attribute 'parse_options'
+6
source share
2 answers

Has the same problem when I use cqlshout pip install cqlsh. Try using the cassandra toolcqlsh

sudo docker run -it cassandra /usr/bin/cqlsh

Refer to jira

+3
source

, , cqlsh - /usr/local/bin/cqlsh. ( $ which cqlsh)

: Cassandra /usr/bin/cqlsh Cassandra - . , Cassandra :

$ /usr/bin/cqlsh <cassandra_listen_ip>

$ /usr/bin/cqlsh <cassandra_listen_ip> -e "<command>"
0

Source: https://habr.com/ru/post/1659092/


All Articles