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

Zhao Yang commented on CASSANDRA-17520:
---------------------------------------

The patch LGTM

> repair vtables should expose a completed field due to lack of filtering 
> options in CQL
> --------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17520
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17520
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Consistency/Repair, CQL/Syntax
>            Reporter: David Capwell
>            Assignee: David Capwell
>            Priority: Normal
>             Fix For: 4.x
>
>
> To find repairs actively running, we need to run the following command
> {code}
> SELECT * 
> FROM system_views.repairs 
> WHERE status IN ('setup', 'start', 'prepare_start', 'prepare_complete', 
> 'repair_start', 'repair_complete')
> ALLOW FILTERING;
> {code}
> This is annoying, and a problem if more states are added in the future…. 
> Ideally we would do one of the following
> NOT IN:
> {code}
> status NOT IN (’success’, ’skip’, ‘failure’)
> {code}
> But this is not currently supported
> {code}
> cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND 
> status NOT IN ('success', 'failure') ALLOW FILTERING;
> SyntaxException: line 1:73 no viable alternative at input 'NOT' (...WHERE 
> duration_millis > 10 AND [status] NOT...)
> {code}
> Not Equals
> {code}
> cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND 
> status != 'success' AND status !='failure' ALLOW FILTERING;
> InvalidRequest: Error from server: code=2200 [Invalid query] 
> message="Unsupported "!=" relation: status != 'success'"
> {code}
> This also fails
> {code}
> cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND 
> status != 'success' AND status !='failure' ALLOW FILTERING;
> InvalidRequest: Error from server: code=2200 [Invalid query] 
> message="Unsupported "!=" relation: status != 'success'"
> {code}
> NULL Checking
> {code}
> state_success_timestamp IS NULL AND state_failure_timestamp IS NULL
> — OR
> state_success_timestamp=null AND state_failure_timestamp=null
> {code}
> This also fails
> {code}
> cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND 
> state_success_timestamp IS NULL ALLOW FILTERING;
> SyntaxException: line 1:93 mismatched input 'NULL' expecting K_NOT (...> 10 
> AND state_success_timestamp IS [NULL]…)
> cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND 
> state_success_timestamp=null ALLOW FILTERING;
> InvalidRequest: Error from server: code=2200 [Invalid query] 
> message="Unsupported null value for column state_success_timestamp"
> {code}
> Given that our filtering logic is restrictive, we need a column to expose if 
> completed or not, so filtering works



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to