I'm using copy in cqlsh to transfer data from a large.csv file into Cassandra. I'm using CQL 3.0 and Cassandra 1.2. I must use another character to submit my data since " is a part of it; I must use any extended ASCII letters. I attempted a number of things but failed.
The following is functional, however for my needs I must use extended ASCII characters.
copy (<columnnames>) from <filename> where deleimiter='|' and quote = '"'; copy (<columnnames>) from <filename> where deleimiter='|' and quote = '~';
When I enter quote=", I get the following error:
:"quotechar" must be an 1-character string
Please provide me guidance on how to set the quotation parameter to utilize an expanded ASCII character.
I appreciate you.
I looked at the cqlsh script's source code since I was experiencing a similar issue. Finding the appropriate python csv settings was necessary in my situation since I was using Python to generate the csv.
Here is the important data from cqlsh:
csv_dialect_defaults = dict(delimiter=',', doublequote=False, escapechar='\\', quotechar='"')
It thus just requires using the csv module with: assuming you are fortunate enough to produce your.csv file using Python.
writer = csv.writer(open("output.csv", 'w'), **csv_dialect_defaults)
Even if you are not using Python, I hope this helps.