Al Elizalde
Al Elizalde

Reputation: 377

Cassandra CQLSH Unrecognized COPY FROM options: maxinserterrors

Does someone knows the right syntaxis for Cassandra COPY FROM command with delimiter and maxinserterrors?

I'm trying to run it as follow:

copy keyspace.table (field1,field2,field3) FROM './iinfo_current_file3.dat' WITH DELIMITER = '|' AND MAXINSERTERRORS = '10';

I'm getting the following error:

<stdin>:2:Unrecognized COPY FROM options: maxinserterrors

I'm using:

cqlsh 5.0.1 | Cassandra 2.1.11.969 | DSE 4.8.3 | CQL spec 3.2.1 | Native protocol v3

Upvotes: 1

Views: 886

Answers (1)

Aaron
Aaron

Reputation: 57748

Your syntax is correct, but your version of Cassandra (cqlsh) is too old. MAXINSERTERRORS is a new option in the 2.1 branch as of 2.1.13: New options and better performance in cqlsh COPY.

To verify, try this:

$ grep -i MAXINSERTERRORS `which cqlsh`

If it is valid, you should see something like:

$ grep -i MAXINSERTERRORS `which cqlsh`
                 'SKIPROWS', 'SKIPCOLS', 'MAXPARSEERRORS', 'MAXINSERTERRORS', 'ERRFILE', 'TTL']
      MAXINSERTERRORS=-1      - the maximum global number of insert errors, -1 means no maximum

And in the newer versions, you might have to look in cqlsh.py:

$ grep -i MAXINSERTERRORS `which cqlsh.py`

Upvotes: 2

Related Questions