0
votes

I have a .cql file that contains some INSERT query, when i run it using

cqlsh -f cassandra.cql

it insert the first one and give me a error:

Traceback (most recent call last): File "/usr/share/dse/resources/cassandra/bin/cqlsh", line 2385, in main(*read_options(sys.argv[1:], os.environ)) File "/usr/share/dse/resources/cassandra/bin/cqlsh", line 2377, in main shell.cmdloop() File "/usr/share/dse/resources/cassandra/bin/cqlsh", line 918, in cmdloop line = self.get_input_line(self.prompt) File "/usr/share/dse/resources/cassandra/bin/cqlsh", line 887, in get_input_line self.lastcmd = self.stdin.readline() File "/usr/lib/python2.7/codecs.py", line 672, in readline return self.reader.readline(size) File "/usr/lib/python2.7/codecs.py", line 527, in readline data = self.read(readsize, firstline=True) File "/usr/lib/python2.7/codecs.py", line 474, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 54: ordinal not in range(128)

and does not insert the rest queries

what is the problem and how can i fix it?

1

1 Answers

2
votes

What it sounds like is that you have some data for an ascii field that contains non-ascii characters. To fix this you should check to see if any of the columns you declare for your tables are of type 'ascii' and change them to 'text' or 'varchar', both of which support unicode characters. Either that or you need to identify the data that contains non-ascii characters and remove the non-ascii characters.