[jira] [Commented] (CASSANDRA-17918) DESCRIBE output does not quote column names using reserved keywords

2023-05-11 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-17918:


Sorry, I am late but adding my +1 for the record.

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.0.10, 4.1.2, 5.0
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2023-05-09 Thread Yifan Cai (Jira)


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

Yifan Cai commented on CASSANDRA-17918:
---

+1 on the patch. Thanks you [~smiklosovic] for taking it up and finding the 
issue with SFUNC/FINALFUNC/etc. 

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.0.x, 4.1.x, 5.x
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2023-05-09 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-17918:
---

[~blerer] would you formally +1 it, please?

4.0 https://github.com/apache/cassandra/pull/2316
4.1 https://github.com/apache/cassandra/pull/2315
trunk https://github.com/apache/cassandra/pull/2308

4.0 j8 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/2182/workflows/4318dee4-ecbe-4bd2-9b16-19b95ef0a908]
4.0 j11 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/2182/workflows/0a057ebc-7ddc-405d-a799-28e755b16430]

4.1 j8 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/2187/workflows/5b533e45-dc6b-4321-9989-be75512d4b80]
4.1 j11 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/2187/workflows/4e175503-d295-4bfb-9bdd-bede3748ccfe]

trunk j8 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/2186/workflows/a3d43d13-482d-4925-84a2-ea618961ecaa]
trunk j11 
[https://app.circleci.com/pipelines/github/instaclustr/cassandra/2186/workflows/eba2fa9a-93b2-4362-8b39-64f11909d53f]

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.0.x, 4.1.x, 5.x
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2023-05-05 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-17918:
---

Thanks, I ll look at that.

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.0.x, 4.1.x, 5.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2023-05-05 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-17918:


[~smiklosovic] I would just add some function and aggregate to the 
{{testDescribeRoundtrip}} testcase as a safety net to the problem you raised 
but otherwise your patch looks good to me.

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.0.x, 4.1.x, 5.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2023-05-04 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-17918:
---

The problem with tests is that the patch introduces this result of aggregate 
description, for example it would describe an aggregate like this:
{code:java}
CREATE AGGREGATE cqlshtests_dligxmowmx.aggmax(int)
    SFUNC cqlshtests_dligxmowmx."fmax"
    STYPE int; {code}
This does not work because the the value of SFUNC is in form "keyspace.name" 
and it does not accept this. There can not be ".". It just expects name of the 
function.

[https://github.com/apache/cassandra/blob/trunk/src/antlr/Parser.g#L671]

[https://github.com/apache/cassandra/blob/trunk/src/antlr/Parser.g#L1567]

So the original author introduced something to CQL but parser was not modified.

I do not know how to fix this. I think we should just leave it out as it was 
and we should just quote the function name. If we are creating an aggregate on 
some keyspace, I do not think that SFUNC is going to ever be something else 
from a function in that keyspace. So the further distinction what keyspace that 
SFUNC is from does not make a lot of sense.

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2023-04-27 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-17918:
---

I will try to refresh this work, I will assign this to myself for a while due 
to the inactivity of the author. 

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-12-08 Thread Yifan Cai (Jira)


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

Yifan Cai commented on CASSANDRA-17918:
---

[~bernardo.botella], bunch of tests failed. Can you take a look? (See the 
circle CI links in my comment).

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-12-08 Thread Yifan Cai (Jira)


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

Yifan Cai commented on CASSANDRA-17918:
---

Rebased all branches and started the full CI runs. I will run the repeated test 
for the new tests after those finishes. 

CI Results (pending):
||Branch||Source||Circle CI||
|cassandra-4.0|[branch|https://github.com/yifan-c/cassandra/tree/commit_remote_branch/CASSANDRA-17918-cassandra-4.0-F5705D26-0685-449B-98DB-523066CDC82C]|[build|https://app.circleci.com/pipelines/github/yifan-c/cassandra?branch=commit_remote_branch%2FCASSANDRA-17918-cassandra-4.0-F5705D26-0685-449B-98DB-523066CDC82C]|
|cassandra-4.1|[branch|https://github.com/yifan-c/cassandra/tree/commit_remote_branch/CASSANDRA-17918-cassandra-4.1-F5705D26-0685-449B-98DB-523066CDC82C]|[build|https://app.circleci.com/pipelines/github/yifan-c/cassandra?branch=commit_remote_branch%2FCASSANDRA-17918-cassandra-4.1-F5705D26-0685-449B-98DB-523066CDC82C]|
|trunk|[branch|https://github.com/yifan-c/cassandra/tree/commit_remote_branch/CASSANDRA-17918-trunk-F5705D26-0685-449B-98DB-523066CDC82C]|[build|https://app.circleci.com/pipelines/github/yifan-c/cassandra?branch=commit_remote_branch%2FCASSANDRA-17918-trunk-F5705D26-0685-449B-98DB-523066CDC82C]|

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-12-07 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-17918:


Thanks [~bernardo.botella]. The patch looks good to me. 
[~yifanc] were the new tests checked for flakiness?

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-12-02 Thread Yifan Cai (Jira)


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

Yifan Cai commented on CASSANDRA-17918:
---

[~blerer] , can you take another look? 

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-12-01 Thread Yifan Cai (Jira)


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

Yifan Cai commented on CASSANDRA-17918:
---

+1 on all the patches. 

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-12-01 Thread Bernardo Botella Corbi (Jira)


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

Bernardo Botella Corbi commented on CASSANDRA-17918:


trunk:
(Java11) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/64/workflows/15069764-2d22-4283-bbf6-d7b7126070d5/jobs/64
(Java8) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/64/workflows/f1f20d80-2715-4823-bf8c-86ce12b00d12/jobs/66

4.0:
(Java11) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/65/workflows/5b39dc4b-aab5-48f6-97a8-799cb1f03179/jobs/65
(Java8) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/65/workflows/522e96af-b49e-4d7c-a5b6-23581751060e/jobs/67

4.1:
(Java11) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/66/workflows/c825e328-9414-401f-95e9-b56a48f87fed/jobs/68
(Java8) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/66/workflows/7fd6b4b4-c0bc-4cb2-8882-2e9f150d27a7/jobs/69

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-11-30 Thread Bernardo Botella Corbi (Jira)


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

Bernardo Botella Corbi commented on CASSANDRA-17918:


Adding circle links

trunk:
(Java11) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/57/workflows/2ecb86fa-c7cb-4768-91a2-4d14657bdd0b/jobs/56
(Java8) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/57/workflows/680a80b7-dc28-4527-a5d9-01b87020675f/jobs/57

4.0:
(Java11) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/62/workflows/4a7b1b07-e65b-4220-bb46-85657f16a23c/jobs/51
(Java8) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/62/workflows/d8586f28-0bee-47f2-95db-ed7a7f655dfd/jobs/55

4.1:
(Java11) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/63/workflows/5ff4002d-3fe1-481a-8929-c7b721dcf139/jobs/50
(Java8) 
https://app.circleci.com/pipelines/github/bbotella/cassandra/63/workflows/db9f99b0-0f6a-4fa2-a5c4-b0234b07c306/jobs/52

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-11-29 Thread Bernardo Botella Corbi (Jira)


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

Bernardo Botella Corbi commented on CASSANDRA-17918:


Here are the patches for the 3 branches:

||Branch||PR||
|trunk|[PR|https://github.com/apache/cassandra/pull/1907]|
|4.0|[PR|https://github.com/apache/cassandra/pull/2035]|
|4.1|[PR|https://github.com/apache/cassandra/pull/2034]|

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-11-29 Thread Yifan Cai (Jira)


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

Yifan Cai commented on CASSANDRA-17918:
---

+1 on the patch to trunk. We will need an additional patch for cassandra-4.1 
branch :|

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-11-18 Thread Bernardo Botella Corbi (Jira)


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

Bernardo Botella Corbi commented on CASSANDRA-17918:


[~yifanc] New revision updated.

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-10-24 Thread Bernardo Botella Corbi (Jira)


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

Bernardo Botella Corbi commented on CASSANDRA-17918:


[~yifanc] I just updated the trunk PR with a new unit test covering (hopefully) 
the missing cases.

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-10-13 Thread Bernardo Botella Corbi (Jira)


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

Bernardo Botella Corbi commented on CASSANDRA-17918:


Hey [~blerer] thanks a lot for the directions! Hopefully this will make more 
sense.

Proposed fix:

||Branch||PR||
|trunk|[PR|https://github.com/apache/cassandra/pull/1907]|
|4.0|[PR|https://github.com/apache/cassandra/pull/1905]|

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-10-11 Thread Benjamin Lerer (Jira)


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

Benjamin Lerer commented on CASSANDRA-17918:


[~bernardo.botella] Thanks a lot for the patches :). Unfortunately, the 
approach you took for the patches is not the correct one (the C* code base 
isconfusing). Internally C* does not keep the quotes. It eliminates them on 
input and add them back when recreating the statements for the DESCRIBE.

I added some information in the *Description* section to help you find the 
parts of the code that need to be modified.

We changed the way DESCRIBE was working in C* 4.0 and moved it on the server 
side before that DESCRIBE was implemented at the CQLSH level using the python 
driver. This bug only affect 4.0, 4.1 and trunk. No need to worry about 3.11 :)

> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
> Fix For: 4.0.x, 4.1.x
>
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement and fetch the 
> create statement from the different schema element using  
> SchemaElement.toCqlString}}



--
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-17918) DESCRIBE output does not quote column names using reserved keywords

2022-10-10 Thread Bernardo Botella Corbi (Jira)


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

Bernardo Botella Corbi commented on CASSANDRA-17918:


Proposed fix:

||Branch||PR||
|trunk|[PR|https://github.com/apache/cassandra/pull/1907]|
|4.0|[PR|https://github.com/apache/cassandra/pull/1905]|
|3.11|[PR|https://github.com/apache/cassandra/pull/1906]|

[Circle 
1|https://app.circleci.com/pipelines/github/bbotella/cassandra/43/workflows/5652e192-67e3-4f1c-b6c7-95b9e3326178]
[Circle 
2|https://app.circleci.com/pipelines/github/bbotella/cassandra/42/workflows/7f7171c6-075b-4bb0-b394-d92a2e201827]


> DESCRIBE output does not quote column names using reserved keywords
> ---
>
> Key: CASSANDRA-17918
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17918
> Project: Cassandra
>  Issue Type: Bug
>  Components: Legacy/CQL
>Reporter: Yifan Cai
>Assignee: Bernardo Botella Corbi
>Priority: Normal
>
> The DESCRIBE output of the column names that using reserved keywords are not 
> quoted for UDTs. The following test reproduces. Reading the code, it looks 
> like that the such columns names are not quoted in materialized view, UDF and 
> user defined aggregation. 
> The impact of the bug is that schema described cannot be imported due to the 
> usage of reserved keywords as column names. 
>  
> {code:java}
>     @Test
>     public void testUsingReservedInCreateType() throws Throwable
>     {
>         String type = createType(KEYSPACE_PER_TEST, "CREATE TYPE %s 
> (\"token\" text, \"desc\" text);");       
> assertRowsNet(executeDescribeNet(KEYSPACE_PER_TEST, "DESCRIBE TYPE " + type),
>                 row(KEYSPACE_PER_TEST, "type", type, "CREATE TYPE " + 
> KEYSPACE_PER_TEST + "." + type + " (\n" +
>                         "    \"token\" text,\n" +
>                         "    \"desc\" text\n" +
>                         ");"));
>     } {code}
> +Additional information for newcomers:+
>  * Unit tests for DESCRIBE statements are in {{DescribeStatementTest}}
>  * The statement implementation is in {{DescribeStatement }}and fetch the 
> create statement from the different schema element using{{ 
> SchemaElement.toCqlString}}



--
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