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

David Capwell commented on CASSANDRA-15570:
-------------------------------------------

Here is the behavior on trunk; the last query made sure to copy/paste the 
column name from the output.

{code}
cqlsh> select * from system_views.local_read_latency;

 keyspace_name      | table_name                     | 50th_ms | 99th_ms | 
count | max_ms  | per_second
--------------------+--------------------------------+---------+---------+-------+---------+------------
            schema1 |                          users |       0 |       0 |     
0 |       0 |          0
             system |                      IndexInfo |       0 |       0 |     
0 |       0 |          0
             system |               available_ranges |       0 |       0 |     
0 |       0 |          0
             system |            available_ranges_v2 |       0 |       0 |     
0 |       0 |          0
             system |                        batches |       0 |       0 |     
0 |       0 |          0
             system |                    built_views |       0 |       0 |     
0 |       0 |          0
             system |             compaction_history |       0 |       0 |     
0 |       0 |          0
             system |                          local |    1.63 | 129.558 |    
28 | 129.558 |      5.036
             system |                          paxos |       0 |       0 |     
0 |       0 |          0
             system |                    peer_events |       0 |       0 |     
0 |       0 |          0
             system |                 peer_events_v2 |       0 |       0 |     
0 |       0 |          0
             system |                          peers |       0 |       0 |     
0 |       0 |          0
             system |                       peers_v2 |       0 |       0 |     
0 |       0 |          0
             system |            prepared_statements |       0 |       0 |     
0 |       0 |          0
             system |                        repairs |       0 |       0 |     
0 |       0 |          0
             system |                 size_estimates |       0 |       0 |     
0 |       0 |          0
             system |               sstable_activity |   0.219 |   0.316 |     
2 |   0.316 |      0.387
             system |             transferred_ranges |       0 |       0 |     
0 |       0 |          0
             system |          transferred_ranges_v2 |       0 |       0 |     
0 |       0 |          0
             system |        view_builds_in_progress |       0 |       0 |     
0 |       0 |          0
        system_auth |            network_permissions |       0 |       0 |     
0 |       0 |          0
        system_auth | resource_role_permissons_index |       0 |       0 |     
0 |       0 |          0
        system_auth |                   role_members |       0 |       0 |     
0 |       0 |          0
        system_auth |               role_permissions |       0 |       0 |     
0 |       0 |          0
        system_auth |                          roles |   1.358 |   1.358 |     
1 |   1.358 |          0
 system_distributed |          parent_repair_history |       0 |       0 |     
0 |       0 |          0
 system_distributed |                 repair_history |       0 |       0 |     
0 |       0 |          0
 system_distributed |              view_build_status |       0 |       0 |     
0 |       0 |          0
      system_schema |                     aggregates |   0.061 |   0.127 |     
4 |   0.127 |      0.774
      system_schema |                        columns |   0.786 |   1.132 |    
11 |   1.132 |      2.128
      system_schema |                dropped_columns |   0.073 |   0.127 |    
11 |   0.127 |      2.128
      system_schema |                      functions |   0.073 |   0.152 |     
4 |   0.152 |      0.774
      system_schema |                        indexes |   0.061 |   0.127 |    
11 |   0.127 |      2.128
      system_schema |                      keyspaces |   0.455 |   1.358 |     
4 |   1.358 |      0.774
      system_schema |                         tables |   0.379 |   3.379 |    
18 |   3.379 |      3.482
      system_schema |                       triggers |   0.088 |   0.219 |    
11 |   0.219 |      2.128
      system_schema |                          types |   0.073 |   0.655 |     
4 |   0.655 |      0.774
      system_schema |                          views |   0.088 |   0.127 |     
4 |   0.127 |      0.774
      system_traces |                         events |       0 |       0 |     
0 |       0 |          0
      system_traces |                       sessions |       0 |       0 |     
0 |       0 |          0

(40 rows)
cqlsh> cqlsh> select 50th_ms from system_views.local_read_latency;
SyntaxException: line 1:9 mismatched input 'th_ms' expecting K_FROM (select 
50[th_ms] from...)
cqlsh> select "50th_ms" from system_views.local_read_latency;

 50th_ms
---------
       0
       0
       0
       0
       0
       0
       0
    1.63
       0
       0
       0
       0
       0
       0
       0
       0
   0.219
       0
       0
       0
       0
       0
       0
       0
   1.358
       0
       0
       0
   0.061
   0.655
   0.073
   0.073
   0.061
   0.455
   0.455
   0.073
   0.073
   0.088
       0
       0

(40 rows)
{code}

With the patch

{code}
cqlsh> select * from system_views.local_read_latency;

 keyspace_name      | table_name                     | count | max_ms | 
p50th_ms | p99th_ms | per_second
--------------------+--------------------------------+-------+--------+----------+----------+------------
             system |                      IndexInfo |     0 |      0 |        
0 |        0 |          0
             system |               available_ranges |     0 |      0 |        
0 |        0 |          0
             system |            available_ranges_v2 |     0 |      0 |        
0 |        0 |          0
             system |                        batches |     0 |      0 |        
0 |        0 |          0
             system |                    built_views |     0 |      0 |        
0 |        0 |          0
             system |             compaction_history |     0 |      0 |        
0 |        0 |          0
             system |                          local |    26 | 36.157 |    
1.132 |   36.157 |      3.683
             system |                          paxos |     0 |      0 |        
0 |        0 |          0
             system |                    peer_events |     0 |      0 |        
0 |        0 |          0
             system |                 peer_events_v2 |     0 |      0 |        
0 |        0 |          0
             system |                          peers |     0 |      0 |        
0 |        0 |          0
             system |                       peers_v2 |     0 |      0 |        
0 |        0 |          0
             system |            prepared_statements |     0 |      0 |        
0 |        0 |          0
             system |                        repairs |     0 |      0 |        
0 |        0 |          0
             system |                 size_estimates |     0 |      0 |        
0 |        0 |          0
             system |               sstable_activity |     0 |      0 |        
0 |        0 |          0
             system |             transferred_ranges |     0 |      0 |        
0 |        0 |          0
             system |          transferred_ranges_v2 |     0 |      0 |        
0 |        0 |          0
             system |        view_builds_in_progress |     0 |      0 |        
0 |        0 |          0
        system_auth |            network_permissions |     0 |      0 |        
0 |        0 |          0
        system_auth | resource_role_permissons_index |     0 |      0 |        
0 |        0 |          0
        system_auth |                   role_members |     0 |      0 |        
0 |        0 |          0
        system_auth |               role_permissions |     0 |      0 |        
0 |        0 |          0
        system_auth |                          roles |     2 |      0 |        
0 |        0 |      0.005
 system_distributed |          parent_repair_history |     0 |      0 |        
0 |        0 |          0
 system_distributed |                 repair_history |     0 |      0 |        
0 |        0 |          0
 system_distributed |              view_build_status |     0 |      0 |        
0 |        0 |          0
      system_schema |                     aggregates |     3 |      0 |        
0 |        0 |       0.46
      system_schema |                        columns |    10 |  0.786 |    
0.379 |    0.786 |      1.532
      system_schema |                dropped_columns |    10 |  0.073 |    
0.061 |    0.073 |      1.532
      system_schema |                      functions |     3 |      0 |        
0 |        0 |       0.46
      system_schema |                        indexes |    10 |  0.152 |    
0.073 |    0.152 |      1.532
      system_schema |                      keyspaces |     6 |      0 |        
0 |        0 |      0.919
      system_schema |                         tables |    16 |  0.379 |    
0.316 |    0.379 |      2.451
      system_schema |                       triggers |    10 |  0.088 |    
0.051 |    0.088 |      1.532
      system_schema |                          types |     3 |      0 |        
0 |        0 |       0.46
      system_schema |                          views |     3 |  0.051 |    
0.051 |    0.051 |       0.46
      system_traces |                         events |     0 |      0 |        
0 |        0 |          0
      system_traces |                       sessions |     0 |      0 |        
0 |        0 |          0

(39 rows)
cqlsh> select p50th_ms, p99th_ms from system_views.local_read_latency;

 p50th_ms | p99th_ms
----------+----------
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
    1.132 |   36.157
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
        0 |        0
    0.379 |    0.786
    0.061 |    0.073
        0 |        0
    0.073 |    0.152
        0 |        0
    0.316 |    0.379
    0.051 |    0.088
        0 |        0
    0.051 |    0.051
        0 |        0
        0 |        0

(39 rows)
{code}

> Change name of table metrics virtual table percentile columns
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-15570
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15570
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Feature/Virtual Tables
>            Reporter: Chris Lohfink
>            Assignee: Chris Lohfink
>            Priority: Low
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The column names {{50th}} and {{90th}} are difficult to query as a selector 
> or in aggregation functions since our parser expects a letter for initial 
> char. It currently requires quoting like:
> {code:sql}
> SELECT table_name, "50th_ms", "99th_ms" FROM system_views.local_read_latency
> {code}
> Which is kinda difficult and non obvious, the error we give when not quoted 
> also isnt that helpful. Since it is percentile a simple thing is to just ad a 
> p infront:
> {code:sql}
> SELECT table_name, p50th_ms, p99th_ms FROM system_views.local_read_latency
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to