[jira] [Assigned] (CASSANDRA-5108) expose overall progress of cleanup tasks in jmx

2023-03-09 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-5108?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh reassigned CASSANDRA-5108:
---

Assignee: Yaman Ziadeh  (was: Krishna Vadali)

> expose overall progress of cleanup tasks in jmx
> ---
>
> Key: CASSANDRA-5108
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5108
> Project: Cassandra
>  Issue Type: New Feature
>  Components: Legacy/Observability, Local/Compaction
>Affects Versions: 1.2.0
>Reporter: Michael Kjellman
>Assignee: Yaman Ziadeh
>Priority: Low
>  Labels: lhf
> Fix For: 5.x
>
>
> it would be nice if, upon starting a cleanup operation, cassandra could 
> maintain a Set (i assume this already exists as we have to know which file to 
> act on next) and a new set of "completed" sstables. When each is compacted 
> remove it from the pending list. That way C* could give an overall completion 
> of the long running and pending cleanup tasks.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-18170) Document cqlsh single quote escaping behavior on complex vs simple types

2023-01-17 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-18170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh updated CASSANDRA-18170:
-
Test and Documentation Plan: Update CQLSH Documentation
 Status: Patch Available  (was: Open)

> Document cqlsh single quote escaping behavior on complex vs simple types
> 
>
> Key: CASSANDRA-18170
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18170
> Project: Cassandra
>  Issue Type: Task
>  Components: Documentation, Documentation/Website, Tool/cqlsh
>Reporter: Paulo Motta
>Assignee: Yaman Ziadeh
>Priority: Normal
>
> cqlsh escapes single quotes on complex types but not on text types:
> Table: {{CREATE TABLE test (name text, foo map, 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}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-18170) Document cqlsh single quote escaping behavior on complex vs simple types

2023-01-17 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-18170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh updated CASSANDRA-18170:
-
Change Category: Semantic
 Complexity: Low Hanging Fruit
  Reviewers: Paulo Motta
 Status: Open  (was: Triage Needed)

> Document cqlsh single quote escaping behavior on complex vs simple types
> 
>
> Key: CASSANDRA-18170
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18170
> Project: Cassandra
>  Issue Type: Task
>  Components: Documentation, Documentation/Website, Tool/cqlsh
>Reporter: Paulo Motta
>Assignee: Yaman Ziadeh
>Priority: Normal
>
> cqlsh escapes single quotes on complex types but not on text types:
> Table: {{CREATE TABLE test (name text, foo map, 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}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-18170) Document cqlsh single quote escaping behavior on complex vs simple types

2023-01-17 Thread Yaman Ziadeh (Jira)


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

Yaman Ziadeh commented on CASSANDRA-18170:
--

Added an "escaping quotes" section in the CQLSH documentation. Created the 
following PR [https://github.com/apache/cassandra/pull/2102] 

> Document cqlsh single quote escaping behavior on complex vs simple types
> 
>
> Key: CASSANDRA-18170
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18170
> Project: Cassandra
>  Issue Type: Task
>  Components: Documentation, Documentation/Website, Tool/cqlsh
>Reporter: Paulo Motta
>Assignee: Yaman Ziadeh
>Priority: Normal
>
> cqlsh escapes single quotes on complex types but not on text types:
> Table: {{CREATE TABLE test (name text, foo map, 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}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Assigned] (CASSANDRA-18170) Document cqlsh single quote escaping behavior on complex vs simple types

2023-01-17 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-18170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh reassigned CASSANDRA-18170:


Assignee: Yaman Ziadeh

> Document cqlsh single quote escaping behavior on complex vs simple types
> 
>
> Key: CASSANDRA-18170
> URL: https://issues.apache.org/jira/browse/CASSANDRA-18170
> Project: Cassandra
>  Issue Type: Task
>  Components: Documentation, Documentation/Website, Tool/cqlsh
>Reporter: Paulo Motta
>Assignee: Yaman Ziadeh
>Priority: Normal
>
> cqlsh escapes single quotes on complex types but not on text types:
> Table: {{CREATE TABLE test (name text, foo map, 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}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-15458) CQL: Unable to escape single quote in a map attribute

2023-01-12 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-15458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh updated CASSANDRA-15458:
-
Status: In Progress  (was: Changes Suggested)

> CQL: Unable to escape single quote in a map attribute
> ---
>
> Key: CASSANDRA-15458
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15458
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter, CQL/Semantics
>Reporter: Abhijeet Singh
>Assignee: Yaman Ziadeh
>Priority: Normal
>  Labels: AdventCalendar2021, lhf
> Attachments: cass-screen.png
>
>
> h3. Overview
> For {{text}} attributes, CQL allows escaping single quote [using additional 
> single 
> quote|http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3c20110803152250.294...@gmx.net%3E].
>  But applying the same syntax for a {{map}} attribute does not 
> work. Inconsistent behavior was observed between {{text}} datatype and 
> {{map}} datatype.
> h3. CQL semantic proposal
> Cassandra (CQL) should apply same escaping semantics on {{text}} and 
> text-within-map {{map}} datatypes.
> h3. Reproducing the bug:
> CREATE query: 
> {code:java}
> CREATE TABLE university.test (id int, data map, PRIMARY KEY 
> (id));{code}
>  INSERT query: 
> {code:java}
> insert into university.test (id, data) values(1, {1:'I''m newb'});{code}
> On running the aforementioned INSERT query, Cassandra inserts and returns 
> {{\{1: 'I''m newb'}}} while the expected result is {{\{1: 'I'm newb'}}}
> h3. Technical details 
> OS: CentOS 7
> Kernel: Linux 3.10.0-1062.9.1.el7.x86_64
> Cassandra version: 3.11.5
> Screenshot: [Output after SELECT query|https://i.stack.imgur.com/PLAan.png]
>   
> +Additional information for newcomers:+
> The issue seems to come from the ANTLR Lexer logic for {{STRING_LITERAL}}. A 
> unit test should also be added in {{SelectTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-15458) CQL: Unable to escape single quote in a map attribute

2023-01-12 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-15458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh updated CASSANDRA-15458:
-
Status: Patch Available  (was: In Progress)

> CQL: Unable to escape single quote in a map attribute
> ---
>
> Key: CASSANDRA-15458
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15458
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter, CQL/Semantics
>Reporter: Abhijeet Singh
>Assignee: Yaman Ziadeh
>Priority: Normal
>  Labels: AdventCalendar2021, lhf
> Attachments: cass-screen.png
>
>
> h3. Overview
> For {{text}} attributes, CQL allows escaping single quote [using additional 
> single 
> quote|http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3c20110803152250.294...@gmx.net%3E].
>  But applying the same syntax for a {{map}} attribute does not 
> work. Inconsistent behavior was observed between {{text}} datatype and 
> {{map}} datatype.
> h3. CQL semantic proposal
> Cassandra (CQL) should apply same escaping semantics on {{text}} and 
> text-within-map {{map}} datatypes.
> h3. Reproducing the bug:
> CREATE query: 
> {code:java}
> CREATE TABLE university.test (id int, data map, PRIMARY KEY 
> (id));{code}
>  INSERT query: 
> {code:java}
> insert into university.test (id, data) values(1, {1:'I''m newb'});{code}
> On running the aforementioned INSERT query, Cassandra inserts and returns 
> {{\{1: 'I''m newb'}}} while the expected result is {{\{1: 'I'm newb'}}}
> h3. Technical details 
> OS: CentOS 7
> Kernel: Linux 3.10.0-1062.9.1.el7.x86_64
> Cassandra version: 3.11.5
> Screenshot: [Output after SELECT query|https://i.stack.imgur.com/PLAan.png]
>   
> +Additional information for newcomers:+
> The issue seems to come from the ANTLR Lexer logic for {{STRING_LITERAL}}. A 
> unit test should also be added in {{SelectTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15458) CQL: Unable to escape single quote in a map attribute

2023-01-12 Thread Yaman Ziadeh (Jira)


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

Yaman Ziadeh commented on CASSANDRA-15458:
--

The tests that failed were all to do with auto completion, they can be found 
here: pylib/cqlshlib/test/test_cqlsh_completion.py. 

Whenever new tables or types are added to 
pylib/cqlshlib/test/test_keyspace_init.cql, their name must be added to the 
appropriate completion tests. In this case, I fixed the broken tests by firstly 
renaming the new table 't1' to a more standard name 'escape_quotes' and the new 
type 'random' to 'quote_udt', then adding them to completion tests 
test_complete_in_create_type, test_complete_in_alter_type, and 
test_complete_in_alter_table respectively. 

> CQL: Unable to escape single quote in a map attribute
> ---
>
> Key: CASSANDRA-15458
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15458
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter, CQL/Semantics
>Reporter: Abhijeet Singh
>Assignee: Yaman Ziadeh
>Priority: Normal
>  Labels: AdventCalendar2021, lhf
> Attachments: cass-screen.png
>
>
> h3. Overview
> For {{text}} attributes, CQL allows escaping single quote [using additional 
> single 
> quote|http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3c20110803152250.294...@gmx.net%3E].
>  But applying the same syntax for a {{map}} attribute does not 
> work. Inconsistent behavior was observed between {{text}} datatype and 
> {{map}} datatype.
> h3. CQL semantic proposal
> Cassandra (CQL) should apply same escaping semantics on {{text}} and 
> text-within-map {{map}} datatypes.
> h3. Reproducing the bug:
> CREATE query: 
> {code:java}
> CREATE TABLE university.test (id int, data map, PRIMARY KEY 
> (id));{code}
>  INSERT query: 
> {code:java}
> insert into university.test (id, data) values(1, {1:'I''m newb'});{code}
> On running the aforementioned INSERT query, Cassandra inserts and returns 
> {{\{1: 'I''m newb'}}} while the expected result is {{\{1: 'I'm newb'}}}
> h3. Technical details 
> OS: CentOS 7
> Kernel: Linux 3.10.0-1062.9.1.el7.x86_64
> Cassandra version: 3.11.5
> Screenshot: [Output after SELECT query|https://i.stack.imgur.com/PLAan.png]
>   
> +Additional information for newcomers:+
> The issue seems to come from the ANTLR Lexer logic for {{STRING_LITERAL}}. A 
> unit test should also be added in {{SelectTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15458) CQL: Unable to escape single quote in a map attribute

2023-01-04 Thread Yaman Ziadeh (Jira)


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

Yaman Ziadeh commented on CASSANDRA-15458:
--

Makes sense, I updated the tests to reflect current behavior and reverted 
pylib/cqlshlib/formatting.py changes.

> CQL: Unable to escape single quote in a map attribute
> ---
>
> Key: CASSANDRA-15458
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15458
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter, CQL/Semantics
>Reporter: Abhijeet Singh
>Assignee: Yaman Ziadeh
>Priority: Normal
>  Labels: AdventCalendar2021, lhf
> Attachments: cass-screen.png
>
>
> h3. Overview
> For {{text}} attributes, CQL allows escaping single quote [using additional 
> single 
> quote|http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3c20110803152250.294...@gmx.net%3E].
>  But applying the same syntax for a {{map}} attribute does not 
> work. Inconsistent behavior was observed between {{text}} datatype and 
> {{map}} datatype.
> h3. CQL semantic proposal
> Cassandra (CQL) should apply same escaping semantics on {{text}} and 
> text-within-map {{map}} datatypes.
> h3. Reproducing the bug:
> CREATE query: 
> {code:java}
> CREATE TABLE university.test (id int, data map, PRIMARY KEY 
> (id));{code}
>  INSERT query: 
> {code:java}
> insert into university.test (id, data) values(1, {1:'I''m newb'});{code}
> On running the aforementioned INSERT query, Cassandra inserts and returns 
> {{\{1: 'I''m newb'}}} while the expected result is {{\{1: 'I'm newb'}}}
> h3. Technical details 
> OS: CentOS 7
> Kernel: Linux 3.10.0-1062.9.1.el7.x86_64
> Cassandra version: 3.11.5
> Screenshot: [Output after SELECT query|https://i.stack.imgur.com/PLAan.png]
>   
> +Additional information for newcomers:+
> The issue seems to come from the ANTLR Lexer logic for {{STRING_LITERAL}}. A 
> unit test should also be added in {{SelectTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-15458) CQL: Unable to escape single quote in a map attribute

2023-01-03 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-15458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh updated CASSANDRA-15458:
-
Test and Documentation Plan: Unit & cqlsh tests.
 Status: Patch Available  (was: Open)

> CQL: Unable to escape single quote in a map attribute
> ---
>
> Key: CASSANDRA-15458
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15458
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter, CQL/Semantics
>Reporter: Abhijeet Singh
>Assignee: Yaman Ziadeh
>Priority: Normal
>  Labels: AdventCalendar2021, lhf
> Attachments: cass-screen.png
>
>
> h3. Overview
> For {{text}} attributes, CQL allows escaping single quote [using additional 
> single 
> quote|http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3c20110803152250.294...@gmx.net%3E].
>  But applying the same syntax for a {{map}} attribute does not 
> work. Inconsistent behavior was observed between {{text}} datatype and 
> {{map}} datatype.
> h3. CQL semantic proposal
> Cassandra (CQL) should apply same escaping semantics on {{text}} and 
> text-within-map {{map}} datatypes.
> h3. Reproducing the bug:
> CREATE query: 
> {code:java}
> CREATE TABLE university.test (id int, data map, PRIMARY KEY 
> (id));{code}
>  INSERT query: 
> {code:java}
> insert into university.test (id, data) values(1, {1:'I''m newb'});{code}
> On running the aforementioned INSERT query, Cassandra inserts and returns 
> {{\{1: 'I''m newb'}}} while the expected result is {{\{1: 'I'm newb'}}}
> h3. Technical details 
> OS: CentOS 7
> Kernel: Linux 3.10.0-1062.9.1.el7.x86_64
> Cassandra version: 3.11.5
> Screenshot: [Output after SELECT query|https://i.stack.imgur.com/PLAan.png]
>   
> +Additional information for newcomers:+
> The issue seems to come from the ANTLR Lexer logic for {{STRING_LITERAL}}. A 
> unit test should also be added in {{SelectTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15458) CQL: Unable to escape single quote in a map attribute

2023-01-03 Thread Yaman Ziadeh (Jira)


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

Yaman Ziadeh commented on CASSANDRA-15458:
--

Created a PR ([https://github.com/apache/cassandra/pull/2063)] to standardize 
all formatting in pylib/cqlshlib/formatting.py to be unquoted (quote=False) and 
escaped. Previously, collections formatting was not consistent with text 
formatting as mentioned above. With these proposed changes, retrieved text, 
map, set, list, tuple, and UDT data will be escaped and unquoted. 

For example,
{code:java}
CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 
'datacenter1': 3};
USE test;
CREATE TABLE t1 (id int, data map, PRIMARY KET (id));
INSERT INTO t1 (id, data) values (1, 'I''m newb');{code}
When fetching Map data from table t1, this would have been the output prior to 
these changes:
{code:java}
 id | data
+---
  1 | {1: 'I''m newb'} {code}
Now, the data will be escaped and unquoted as such:
{code:java}
 id | data
+---
  1 | {1: I'm newb} {code}
Previously for Sets:
{code:java}
 id | data
+
  1 | {'I''m newb'} {code}
and now:
{code:java}
 id | data
+
  1 | {I'm newb}{code}
Previously for UDTs:
{code:java}
CREATE TYPE random (data text);
CREATE TABLE t5 (id int, data random, PRIMARY KEY(id));
INSERT INTO t5 (id, data) values (1, {data: 'I''m newb'});
SELECT * FROM t5;

 id | data
+--
  1 | {data: 'I''m newb'} {code}
and now:
{code:java}
 id | data
+--
  1 | {data: I'm newb} {code}

Let me know what you think!




 

 

> CQL: Unable to escape single quote in a map attribute
> ---
>
> Key: CASSANDRA-15458
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15458
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter, CQL/Semantics
>Reporter: Abhijeet Singh
>Assignee: Yaman Ziadeh
>Priority: Normal
>  Labels: AdventCalendar2021, lhf
> Attachments: cass-screen.png
>
>
> h3. Overview
> For {{text}} attributes, CQL allows escaping single quote [using additional 
> single 
> quote|http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3c20110803152250.294...@gmx.net%3E].
>  But applying the same syntax for a {{map}} attribute does not 
> work. Inconsistent behavior was observed between {{text}} datatype and 
> {{map}} datatype.
> h3. CQL semantic proposal
> Cassandra (CQL) should apply same escaping semantics on {{text}} and 
> text-within-map {{map}} datatypes.
> h3. Reproducing the bug:
> CREATE query: 
> {code:java}
> CREATE TABLE university.test (id int, data map, PRIMARY KEY 
> (id));{code}
>  INSERT query: 
> {code:java}
> insert into university.test (id, data) values(1, {1:'I''m newb'});{code}
> On running the aforementioned INSERT query, Cassandra inserts and returns 
> {{\{1: 'I''m newb'}}} while the expected result is {{\{1: 'I'm newb'}}}
> h3. Technical details 
> OS: CentOS 7
> Kernel: Linux 3.10.0-1062.9.1.el7.x86_64
> Cassandra version: 3.11.5
> Screenshot: [Output after SELECT query|https://i.stack.imgur.com/PLAan.png]
>   
> +Additional information for newcomers:+
> The issue seems to come from the ANTLR Lexer logic for {{STRING_LITERAL}}. A 
> unit test should also be added in {{SelectTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Assigned] (CASSANDRA-15458) CQL: Unable to escape single quote in a map attribute

2022-12-12 Thread Yaman Ziadeh (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-15458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yaman Ziadeh reassigned CASSANDRA-15458:


Assignee: Yaman Ziadeh

> CQL: Unable to escape single quote in a map attribute
> ---
>
> Key: CASSANDRA-15458
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15458
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter, CQL/Semantics
>Reporter: Abhijeet Singh
>Assignee: Yaman Ziadeh
>Priority: Normal
>  Labels: AdventCalendar2021, lhf
> Attachments: cass-screen.png
>
>
> h3. Overview
> For {{text}} attributes, CQL allows escaping single quote [using additional 
> single 
> quote|http://mail-archives.apache.org/mod_mbox/cassandra-user/201108.mbox/%3c20110803152250.294...@gmx.net%3E].
>  But applying the same syntax for a {{map}} attribute does not 
> work. Inconsistent behavior was observed between {{text}} datatype and 
> {{map}} datatype.
> h3. CQL semantic proposal
> Cassandra (CQL) should apply same escaping semantics on {{text}} and 
> text-within-map {{map}} datatypes.
> h3. Reproducing the bug:
> CREATE query: 
> {code:java}
> CREATE TABLE university.test (id int, data map, PRIMARY KEY 
> (id));{code}
>  INSERT query: 
> {code:java}
> insert into university.test (id, data) values(1, {1:'I''m newb'});{code}
> On running the aforementioned INSERT query, Cassandra inserts and returns 
> {{\{1: 'I''m newb'}}} while the expected result is {{\{1: 'I'm newb'}}}
> h3. Technical details 
> OS: CentOS 7
> Kernel: Linux 3.10.0-1062.9.1.el7.x86_64
> Cassandra version: 3.11.5
> Screenshot: [Output after SELECT query|https://i.stack.imgur.com/PLAan.png]
>   
> +Additional information for newcomers:+
> The issue seems to come from the ANTLR Lexer logic for {{STRING_LITERAL}}. A 
> unit test should also be added in {{SelectTest}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org