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

Document cqlsh single quote escaping behavior on complex vs simple types

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Normal
    • Resolution: Duplicate
    • None
    • Documentation, Tool/cqlsh
    • None
    • Semantic
    • Low Hanging Fruit
    • All
    • None
    • Hide

      Update CQLSH Documentation

      Show
      Update CQLSH Documentation

    Description

      cqlsh escapes single quotes on complex types but not on text types:

      Table: CREATE TABLE test (name text, foo map<text,text>, PRIMARY KEY(name));

      Insert:

      INSERT INTO test (name, foo) VALUES ( 'jos''emy',{'foo':'josemy''s houñse'});

      Query: SELECT * FROM test;

       name    | foo
      -----------+-----------------------------
       jos'emy | {'foo': 'josemy''s houñse'}
      

      This behavior is confusing because simple text fields containing single quotes are not escaped on cqlsh, while complex types (such as collections or UDTs) are escaped. A couple of tickets were created to clarify this behavior: CASSANDRA-10263 and CASSANDRA-15458.

      We should probably document this behavior on cqlsh documentation to avoid confusion.

      Attachments

        Issue Links

          Activity

            People

              yziadeh Yaman Ziadeh
              paulo Paulo Motta
              Yaman Ziadeh
              Paulo Motta
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: