Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-15990

Running CQL command with non-ASCII values raises UnicodeDecodeError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 4.0-beta2, 4.0
    • Tool/cqlsh
    • None

    Description

      There are INSERT statements that contains non-ASCII values that have run fine in Cassandra 3.11, but now raises a UnicodeDecodeError when I try executing them in 4.0-alpha4 and 4.0-beta1. 

      Example input and output:

      echo $LANG
      en_US.UTF-8
      $ cqlsh --debug
      Using CQL driver: <module 'cassandra' from '/usr/share/cassandra/bin/../lib/cassandra-driver-internal-only-3.23.0.post0-1a184b99.zip/cassandra-driver-3.23.0.post0-1a184b99/cassandra/__init__.py'>
      Using connect timeout: 5 seconds
      Using 'utf-8' encoding
      Using ssl: False
      Connected to Cassandra Cluster at 127.0.0.1:9042.
      [cqlsh 5.0.1 | Cassandra 4.0-beta1 | CQL spec 3.4.5 | Native protocol v4]
      Use HELP for help.
      cqlsh> CREATE KEYSPACE killr_video WITH replication = {'class': 'NetworkTopologyStrategy', 'DC-Houston': 1};
      cqlsh> USE killr_video;
      cqlsh:killr_video> CREATE TABLE movies_by_genre ( genre TEXT, title TEXT, year INT, duration INT, avg_rating FLOAT, country TEXT, PRIMARY KEY ((genre), title, year));
      cqlsh:killr_video> INSERT INTO movies_by_genre (genre, title, year, duration, avg_rating, country)
       ... VALUES ('Action', 'The Extraordinary Adventures of Adèle Blanc-Sec', 2010, 107, 6.30, 'France');
      Traceback (most recent call last):
       File "/usr/share/cassandra/bin/cqlsh.py", line 937, in onecmd
       self.handle_statement(st, statementtext)
       File "/usr/share/cassandra/bin/cqlsh.py", line 962, in handle_statement
       readline.add_history(new_hist)
      UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 134: ordinal not in range(128)

      Attachments

        Activity

          People

            e.dimitrova Ekaterina Dimitrova
            joechu Joseph Chu
            Ekaterina Dimitrova
            Brandon Williams, David Capwell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: