I am trying to import a csv dump in my cassandra table using the copy
command.
It works fine except for tables which contain counter column.
For these tables I get the following error message:
code=2200 [Invalid query] message="INSERT statement are not allowed on counter tables, use UPDATE instead"
Is there a workaround here? How can I bulk import the data from my csv file in my table?
Many thanks
The documentation on the COPY command is pretty clear on this one:
You cannot copy data to or from counter tables.
As mentioned in this similar question(How can a CSV file with counter columns be loaded to a Cassandra CQL3 table), you can load tables with counter columns using the sstableloader.
There does not appear to be a ticket addressing this problem in the Cassandra JIRA project, either. You are welcome to create one, but there are some underlying issues that would make this difficult (basically, COPY TO
also uses CQL and would also be subject to the restriction about setting a specific counter value vs. incrementing it).
EDIT 20180525
As of CASSANDRA-9043 tables with counter columns should now work with the COPY command.