Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-10733

Inconsistencies in CQLSH auto-complete

    XMLWordPrintableJSON

Details

    • Low

    Description

      Auto-complete in cqlsh does not work correctly on some commands. We see some inconsistent behaviour when completing part of the statement and hitting the tab key.

      Works correctly
      Auto-complete on 'desc table ', 'desc function ' and 'desc type ' works correctly. We see a list of all tables (or functions, types) in the current keyspace plus a list of all available keyspaces followed by a full stop (e.g. system.)

      cqlsh:fxaggr> desc TABLE 
                           minutedata           system_distributed.
      ;                    rawtickdatabylp      system_traces.
      <enter>              rawtickdatabysymbol  tickdata
      daydata              system.              
      fxaggr.              system_auth.     
      

      Fix required
      'desc aggregate ' displays the aggregates in the current keyspace (in this case, only 1, called 'average') but does not display a list of available keyspaces. It only displays the current keyspace, with no following full stop.

      cqlsh:fxaggr> desc aggregate 
               ;        <enter>  average  fxaggr
      

      Works correctly
      Auto-complete on 'desc table <keyspace>. ' and 'desc type <keyspace>.' works correctly. We see a list of all tables (or types) in the current keyspace

      cqlsh:fxaggr> desc table fxaggr.
      daydata              rawtickdatabylp      tickdata
      minutedata           rawtickdatabysymbol  
      

      Fix required
      Auto-complete on 'desc function <keyspace>. ' and 'desc aggregate <keyspace>.' works inconsistently. In a keyspace with 2 functions, both beginning with the letters 'avg', if I type 'desc function <keyspace>' and hit tab, auto-complete will result in this: 'desc function fxaggr.avg ' and will not display the matching functions. If I type 'desc function <keyspace>.' (note the trailing full stop) and hit tab, auto-complete will work correctly:

      cqlsh:fxaggr> desc function fxaggr.avg
      avgfinal  avgstate  
      

      If I type 'desc aggregate <keyspace>' and hit tab, auto-complete returns 'desc aggregate <keyspace> ' (it adds a space) and does not show me the list of available aggregates. If I type 'desc aggregate <keyspace>.' (note the trailing full stop) and hit tab, auto-complete will work correctly.

      Attachments

        1. CASSANDRA-3.0-10733-CQLSH-Auto.patch
          1 kB
          Michael Edge
        2. CASSANDRA-2.2-10733-tests.patch
          7 kB
          Michael Edge
        3. CASSANDRA-2.2-10733-CQLSH-Auto.patch
          1 kB
          Michael Edge
        4. 10733-fix-space-2.2.txt
          0.7 kB
          Tom Hobbs

        Activity

          People

            michaeledge Michael Edge
            michaeledge Michael Edge
            Michael Edge
            Tom Hobbs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: