[ 
https://issues.apache.org/jira/browse/CASSANDRA-10263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14953569#comment-14953569
 ] 

Benjamin Lerer commented on CASSANDRA-10263:
--------------------------------------------

Cassandra returns the collection values without quotes. Therefore, if you 
retrieve the values from a driver they will not contains double quotes.

{{cqlsh}} print the collection values {{quoted}} and by consequence also escape 
the single quotes.
The behavior might be surprising but it is the expected one.

> Insert in Cassandra in a collection, values with single quote
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-10263
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10263
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Jduarte
>            Assignee: Benjamin Lerer
>         Attachments: terminal.png
>
>
> I think there is a problem with single quotes in collection fields. This is 
> what I try:
> Table: {{CREATE TABLE test (name text, foo map<text,text>, PRIMARY 
> KEY(name));}}
> Insert:  {code}INSERT INTO test (name, foo) VALUES ( 
> 'jos''emy',{'foo':'josemy''s houñse'});{code}
> Query: {{SELECT * FROM  test;}}
> {code}
>  name    | foo
> -----------+-----------------------------
>  jos'emy | {'foo': 'josemy''s houñse'}
> {code}
> As you can see, Cassandra replace the double quote in the simple "name" 
> field, but does not replace the quotes in the field inside the map. The 
> result (I think) should be:
> {code}
>  name    | foo
> ---------+-----------------------------
>  jos'emy |   {'foo': 'josemy's houñse'}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to