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

cqlsh can't describe when index options contain unicode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Legacy/Tools
    • Labels:
      None
    • Severity:
      Normal
    • Since Version:

      Description

      The following `describe` fails in `cqlsh`:

       

      $ cqlsh
      
      cqlsh> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
      
      cqlsh> CREATE TABLE test ( one text, two int, three text, PRIMARY KEY (one,two) );
      
      cqlsh> CREATE CUSTOM INDEX ON test.test (three) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = { 'delimiter': '░'};
      
      cqlsh> DESCRIBE KEYSPACE test ;
      
      'ascii' codec can't decode byte 0xe2 in position 31: ordinal not in range(128)
      
      

       

      Full error is 

      Traceback (most recent call last):
        File "/usr/bin/cqlsh.py", line 919, in onecmd
          self.handle_statement(st, statementtext)
        File "/usr/bin/cqlsh.py", line 956, in handle_statement
          return custom_handler(parsed)
        File "/usr/bin/cqlsh.py", line 1539, in do_describe
          self.describe_keyspace(ksname)
        File "/usr/bin/cqlsh.py", line 1275, in describe_keyspace
          self.print_recreate_keyspace(self.get_keyspace_meta(ksname), sys.stdout)
        File "/usr/bin/cqlsh.py", line 1225, in print_recreate_keyspace
          out.write(ksdef.export_as_string())
        File "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/metadata.py", line 661, in export_as_string
          + [t.export_as_string() for t in self.tables.values()])
        File "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/metadata.py", line 1116, in export_as_string
          ret = self._all_as_cql()
        File "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/metadata.py", line 1125, in _all_as_cql
          ret += "\n%s;" % index.as_cql_query()
        File "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/metadata.py", line 1402, in as_cql_query
          ret += " WITH OPTIONS = %s" % Encoder().cql_encode_all_types(options)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              michaelsembwever mck
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: