[jira] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 10:28 PM:
---

[~smiklosovic]  Thanks for the quick review and commit!

CAPTURE OFF wasn't working currently in the other branches, maybe we should 
patch this in 5.0.

[~gautamg] 

While testing, I noticed another issue 
[CASSANDRA-20099|https://issues.apache.org/jira/browse/CASSANDRA-20099] with 
TRACING when the data is paged where it prints the trace output multiple times.

We could add CAPTURE output consistency there and maybe use of Switch.  


was (Author: bschoeni):
[~smiklosovic]  Thanks for the quick review and commit!

CAPTURE OFF wasn't working currently in the other branches, maybe we should 
patch this in 5.0.

[~gautamg] 

I can submit a Jira for output consistency and maybe use of Switch.  While 
testing, I noticed another issue TRACING when the data is paged where it prints 
the trace output multiple times.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Fix For: 5.1
>
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 10:32 PM:
---

[~smiklosovic]  Thanks for the quick review and commit!

CAPTURE OFF wasn't working currently in the other branches (due to 
cqlsh_capture_cmd_syntax_rules), maybe we should patch this in 5.0?

[~gautamg] 

While testing, I noticed another issue CASSANDRA-20099 with TRACING when the 
data is paged where it prints the trace output multiple times.

We could add CAPTURE output consistency there and maybe use of Switch.  


was (Author: bschoeni):
[~smiklosovic]  Thanks for the quick review and commit!

CAPTURE OFF wasn't working currently in the other branches, maybe we should 
patch this in 5.0.

[~gautamg] 

While testing, I noticed another issue 
[CASSANDRA-20099|https://issues.apache.org/jira/browse/CASSANDRA-20099] with 
TRACING when the data is paged where it prints the trace output multiple times.

We could add CAPTURE output consistency there and maybe use of Switch.  

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Fix For: 5.1
>
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 10:18 PM:
---

[~smiklosovic]  Thanks for the quick review and commit!

CAPTURE OFF wasn't working currently in the other branches, maybe we should 
patch this in 5.0.

[~gautamg] 

I can submit a Jira for output consistency and maybe use of Switch.  While 
testing, I noticed another issue TRACING when the data is paged where it prints 
the trace output multiple times.


was (Author: bschoeni):
[~smiklosovic]  Thanks for the quick review and commit!

CAPTURE OFF wasn't working currently in the other branches, maybe we should 
patch this in 5.0.

[~gautamg] 

I can submit a Jira for output consistency and maybe use of Switch.  While 
testing, I noticed another issue with CAPTURE and TRACING when the data is 
paged where it prints the trace output multiple times.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Fix For: 5.1
>
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic edited comment on CASSANDRA-19105 at 11/20/24 2:15 PM:
-

[~bschoeni]
{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE OFF;
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

Apart from all of that, TRACING with CAPTURE works, not issues with that. 


was (Author: smiklosovic):
[~bschoeni]
{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

Apart from all of that, TRACING with CAPTURE works, not issues with that. 

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic edited comment on CASSANDRA-19105 at 11/20/24 2:14 PM:
-

[~bschoeni]
{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

Apart from all of that, TRACING with CAPTURE works, not issues with that. 


was (Author: smiklosovic):
[~bschoeni]

CAPTURE OFF is not working:

{code}
$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.3.0 | Cassandra 5.1-SNAPSHOT | CQL spec 3.4.8 | Native protocol v5]
Use HELP for help.
cassandra@cqlsh> CAPTURE OFF;
Currently not capturing query output.
cassandra@cqlsh> CAPTURE 
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
cassandra@cqlsh> CAPTURE OFF
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
{code}

CAPTURE OFF does not seem to do anything after it is on. This will end up 
having system_auth.roles twice in /tmp/output. 

Also, if we have this:

{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

Apart from all of that, TRACING with CAPTURE works, not issues with that. 

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic edited comment on CASSANDRA-19105 at 11/20/24 2:16 PM:
-

[~bschoeni]
{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE OFF;
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

Apart from all of that, TRACING with CAPTURE works, not issues with that. 

Thank you for fixing CAPTURE OFF.

I think that he proposed changes are not blockers for this ticket to be merged. 
Might be left for other ticket.

+1


was (Author: smiklosovic):
[~bschoeni]
{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE OFF;
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

Apart from all of that, TRACING with CAPTURE works, not issues with that. 

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic edited comment on CASSANDRA-19105 at 11/20/24 2:11 PM:
-

[~bschoeni]

CAPTURE OFF is not working:

{code}
$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.3.0 | Cassandra 5.1-SNAPSHOT | CQL spec 3.4.8 | Native protocol v5]
Use HELP for help.
cassandra@cqlsh> CAPTURE OFF;
Currently not capturing query output.
cassandra@cqlsh> CAPTURE 
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
cassandra@cqlsh> CAPTURE OFF
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
{code}

CAPTURE OFF does not seem to do anything after it is on. This will end up 
having system_auth.roles twice in /tmp/output. 

Also, if we have this:

{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

Apart from all of that, TRACING with CAPTURE works, not issues with that. 


was (Author: smiklosovic):
[~bschoeni]

CAPTURE OFF is not working:

{code}
$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.3.0 | Cassandra 5.1-SNAPSHOT | CQL spec 3.4.8 | Native protocol v5]
Use HELP for help.
cassandra@cqlsh> CAPTURE OFF;
Currently not capturing query output.
cassandra@cqlsh> CAPTURE 
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
cassandra@cqlsh> CAPTURE OFF
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
{code}

CAPTURE OFF does not seem to do anything after it is on. This will end up 
having system_auth.roles twice in /tmp/output. 

Also, if we have this:

{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-20 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic edited comment on CASSANDRA-19105 at 11/20/24 2:10 PM:
-

[~bschoeni]

CAPTURE OFF is not working:

{code}
$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.3.0 | Cassandra 5.1-SNAPSHOT | CQL spec 3.4.8 | Native protocol v5]
Use HELP for help.
cassandra@cqlsh> CAPTURE OFF;
Currently not capturing query output.
cassandra@cqlsh> CAPTURE 
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
cassandra@cqlsh> CAPTURE OFF
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
{code}

CAPTURE OFF does not seem to do anything after it is on. This will end up 
having system_auth.roles twice in /tmp/output. 

Also, if we have this:

{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}


was (Author: smiklosovic):
[~bschoeni]

CAPTURE OFF is not working:

{code}
$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.3.0 | Cassandra 5.1-SNAPSHOT | CQL spec 3.4.8 | Native protocol v5]
Use HELP for help.
cassandra@cqlsh> CAPTURE OFF;
Currently not capturing query output.
cassandra@cqlsh> CAPTURE 
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
cassandra@cqlsh> CAPTURE OFF
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> select * from system_auth.roles;
{code}

CAPTURE OFF does not seem to do anything.

Also, if we have this:

{code}
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> ELAPSED 
ELAPSED is OFF
cassandra@cqlsh> TRACING
TRACING is OFF
cassandra@cqlsh> CAPTURE
Currently not capturing query output.
cassandra@cqlsh> CAPTURE '/tmp/output'
Now capturing query output to '/tmp/output'.
cassandra@cqlsh> CAPTURE
Currently capturing query output to '/tmp/output'.
cassandra@cqlsh> 
{code}

I would expect that if CAPUTRE is turned off, it would be just telling me 
"CAPTURE is OFF" to be consistent with the rest.

If it is turned  on, it might be like this or similar:

{code}
cassandra@cqlsh> CAPTURE
CAPTURE is ON, writing to /tmp/output
{code}

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:54 AM:
--

I agree the current code works to fix the bug, but generally, committers want 
to see clean code.  

Sometimes, when you fix one bug, you uncover another issue, and that's what I 
see with the BNF for CAPTURE.


was (Author: bschoeni):
I agree the current code works to fix the bug, but generally, committers want 
to see clean code. 

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:55 AM:
--

I agree the current code works nicely to fix the bug, but generally, committers 
want to see clean code.  

Sometimes, when you fix one bug, you uncover another issue, and that's what I 
see with the BNF for CAPTURE.


was (Author: bschoeni):
I agree the current code works to fix the bug, but generally, committers want 
to see clean code.  

Sometimes, when you fix one bug, you uncover another issue, and that's what I 
see with the BNF for CAPTURE.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 5:04 AM:
--

{quote}{{ ::= "CAPTURE" ( switch=(  | "OFF" ))?}}
{quote}
should be much simpler to parse in cqlshmain.py 


was (Author: bschoeni):
{quote}{{ ::= "CAPTURE" ( switch=(  | "OFF" ))?}}
{quote}
should be much simplier to parse in cqlshmain.py 

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:59 AM:
--

I agree the current code works nicely to fix the bug, but generally, committers 
want to see clean code.  

Sometimes, when you fix one bug, you uncover another issue, and that's what I 
see with the BNF for CAPTURE.

The reason for [1][0] and [1][1] was that the syntax definition (BNF) didn't 
correctly specify fname OR 'off'.


was (Author: bschoeni):
I agree the current code works nicely to fix the bug, but generally, committers 
want to see clean code.  

Sometimes, when you fix one bug, you uncover another issue, and that's what I 
see with the BNF for CAPTURE.

The reason for [1][0] and [1][1] was that the syntax definition (BNF) didn't 
correctly specify fname OR off.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:58 AM:
--

I agree the current code works nicely to fix the bug, but generally, committers 
want to see clean code.  

Sometimes, when you fix one bug, you uncover another issue, and that's what I 
see with the BNF for CAPTURE.

The reason for [1][0] and [1][1] was that the syntax definition (BNF) didn't 
correctly specify fname OR off.


was (Author: bschoeni):
I agree the current code works nicely to fix the bug, but generally, committers 
want to see clean code.  

Sometimes, when you fix one bug, you uncover another issue, and that's what I 
see with the BNF for CAPTURE.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Gautam G (Jira)


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

Gautam G edited comment on CASSANDRA-19105 at 11/20/24 4:56 AM:


Got it, I will make the changes.


was (Author: gautamg):
Got it, i will make the changes.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:54 AM:
--

[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd double array indexing code 
was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNF production rule in cqlshhandling.py for CAPTURE is 
poorly done because it separates the fname from the OFF value and doesn't 
provide a name to bind on:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be done switch style with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to 
{color:#4c9aff}parsed.get_binding('switch'){color} and the switch value will be 
either a filename, Off or None.


was (Author: bschoeni):
[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd double array indexing code 
was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done because it separates the fname from the OFF value and doesn't 
provide a name to bind on:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be done switch style with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to 
{color:#4c9aff}parsed.get_binding('switch'){color} and the switch value will be 
either a filename, Off or None.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:29 AM:
--

[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done because it separates the fname from the OFF value and doesn't 
provide a name to bind on:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be done switch style with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to 
{color:#4c9aff}parsed.get_binding('switch'){color} and the switch value will be 
either a filename, Off or None.


was (Author: bschoeni):
[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done because it separates the fname from the OFF value and doesn't 
provide a name to bind on:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be switch with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to 
{color:#4c9aff}parsed.get_binding('switch'){color} and the switch value will be 
either a filename, Off or None.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:30 AM:
--

[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd double array indexing code 
was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done because it separates the fname from the OFF value and doesn't 
provide a name to bind on:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be done switch style with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to 
{color:#4c9aff}parsed.get_binding('switch'){color} and the switch value will be 
either a filename, Off or None.


was (Author: bschoeni):
[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done because it separates the fname from the OFF value and doesn't 
provide a name to bind on:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be done switch style with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to 
{color:#4c9aff}parsed.get_binding('switch'){color} and the switch value will be 
either a filename, Off or None.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:29 AM:
--

[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done because it separates the fname from the OFF value and doesn't 
provide a name to bind on:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be switch with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to 
{color:#4c9aff}parsed.get_binding('switch'){color} and the switch value will be 
either a filename, Off or None.


was (Author: bschoeni):
[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be switch with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to parsed.get_binding('switch') and the 
switch value will be either a filename, Off or None.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:24 AM:
--

[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling.py for CAPTURE is 
poorly done:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be switch with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to parsed.get_binding('switch') and the 
switch value will be either a filename, Off or None.


was (Author: bschoeni):
[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling for CAPTURE is poorly 
done:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be switch with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to parsed.get_binding('switch') and the 
switch value will be either a filename, Off or None.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-11-19 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/20/24 4:22 AM:
--

[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling for CAPTURE is poorly 
done:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be switch with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
with this, cqlshmain can be simplified to parsed.get_binding('switch') and the 
switch value will be either a filename, Off or None.


was (Author: bschoeni):
[~gautamg]  thanks, the pytest and pycodestyle look great, and the capture 
works as it should.

{_}However{_}, I was looking at the reason this odd code was needed 
{quote}if parsed.matched[1][0] == 'identifier' and parsed.matched[1][1].upper() 
== 'OFF':
{quote}
The reasons is the BNR production rule in cqlshhandling for CAPTURE is poorly 
done:
{quote} ::= "CAPTURE" ( fname=( ) | "OFF" )?
{quote}
Instead, this should be switch with two values: fname/OFF, so 
{quote} ::= "CAPTURE" ( switch=(  | "OFF" ))?
{quote}
then, cqlshmain can be simplified to parsed.get_binding('switch') and the 
switch value will be either a filename, Off or None.

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
> Example:
> {quote}> TRACING ON;
> > select * from system_schema.columns LIMIT 1;
> > CAPTURE 'foo'
> {quote}
> this should display only the tracing information
> {quote}> CAPTURE OFF
> {quote}
> displays results and then the tracing
> {quote}> TRACING OFF
> {quote}
> displays only the results



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-10-31 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 11/1/24 2:46 AM:
-

[~gautamg] you need to install wcwidth

{{pip install wcwidth}}

 

I ran the following:

% pycodestyle --ignore E501,E402,E731,W503 *.py         

cqlshmain.py:1547:1: W293 blank line contains whitespace

tracing.py:44:13: E117 over-indented

tracing.py:60:5: E303 too many blank lines (3)

tracing.py:73:1: E303 too many blank lines (3)


was (Author: bschoeni):
[~gautamg] you need to install wcwidth

{{pip install wcwidth}}

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
>  



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-10-21 Thread Gautam G (Jira)


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

Gautam G edited comment on CASSANDRA-19105 at 10/22/24 6:01 AM:


Hi [~bschoeni], I did the test. Is this the report that we expect. 
[^test_results.txt]

 

^I followed following steps:^
 # CQL_TEST_HOST, default 127.0.0.1

 # CQL_TEST_PORT, default 9042

 # CQL_TEST_USER, default 'cassandra'

 # pip install cassandra-driver
 # in pylib/cqlshlib I ran pytest, the file attached was the result.

Is this how we are supposed to do. 
 


was (Author: gautamg):
Hi [~bschoeni], I did the test. Is this the report that we expect. 
[^test_results.txt]

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
> Attachments: test_results.txt, trunk_test_results.txt
>
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
>  



--
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] [Comment Edited] (CASSANDRA-19105) Fix CQLSH Capture to save query results only and not trace details when Tracing is on

2024-10-09 Thread Brad Schoening (Jira)


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

Brad Schoening edited comment on CASSANDRA-19105 at 10/9/24 9:44 PM:
-

[~gautamg] ok, can you link the PR URL as an attachment and click submit patch. 
 Confirm that you've ran the pytests and pycodestyle (on the files modified).

{{$ pycodestyle --ignore E501,E402,E731,W503 cqlshlib/*.py}}

 


was (Author: bschoeni):
[~gautamg] ok, can you link the PR URL as an attachment and click submit patch. 
 Confirm that you've ran the pytests and pycodestyle (on the files modified).

{{$ pycodestyle --ignore E501,E402,E731,W503 */*.py}}

 

> Fix CQLSH Capture to save query results only and not trace details when 
> Tracing is on
> -
>
> Key: CASSANDRA-19105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19105
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL/Interpreter
>Reporter: Brad Schoening
>Assignee: Gautam G
>Priority: Normal
>
> When using *Tracing* in CQLSH, it's sometimes helpful to use *Capture* to 
> avoid paging through output when you want to see the trace results.  However, 
> the trace results are also incorrectly captured to the output file.
> According to *Help Capture* (below), only the query result should be saved. 
> The correct behavior should display the trace results and only capture the 
> query results.
>         {_}Help capture message{_}:  Only query result output is captured. 
> Errors and output from cqlsh-only commands will still be shown in the cqlsh 
> session.
>  



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