You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that cqlsh escapes non-printable characters in text columns in a certain way, and then doesn't allow you to use the same format in queries. For example:
CREATE KEYSPACE ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor': 1 };
USE ks;
CREATE TABLE cf (pk text primary key);
INSERT INTO cf (pk) values ('^A'); # "^A" is control-A. Type control-V and then control
When we use SELECT we see the following:
pk
------
\x01
(1 rows)
Note how the character 1 (control-A) is shown here as '\x01'.
However, one cannot use this syntax on input: The string '\x01' is treated literally as those 4 characters, and not translated to character 1:
cqlsh:ks> select * from cf where pk='\x01';
pk
----
(0 rows)
To read this row, one needs to type control-A (usually control-V control-A) again.. But there's no way to guess this from the SELECT output.
cqlsh:ks> select * from cf where pk='^A';
pk
------
\x01
(1 rows)
The text was updated successfully, but these errors were encountered:
nyh
changed the title
cqlsh - inconsistent escaping of non-printable character.input and output
cqlsh - inconsistent escaping of non-printable characters
Oct 29, 2018
This issue in cqlsh caused @juliayakovlev and me a lot of grief. It was also reported in Cassandra years ago - see https://issues.apache.org/jira/browse/CASSANDRA-8790 - but never solved.
The problem is that cqlsh escapes non-printable characters in text columns in a certain way, and then doesn't allow you to use the same format in queries. For example:
When we use SELECT we see the following:
Note how the character 1 (control-A) is shown here as '\x01'.
However, one cannot use this syntax on input: The string '\x01' is treated literally as those 4 characters, and not translated to character 1:
To read this row, one needs to type control-A (usually control-V control-A) again.. But there's no way to guess this from the SELECT output.
The text was updated successfully, but these errors were encountered: