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

Enable cassandra-cli to list rows, and page through rows in a column family

    XMLWordPrintableJSON

Details

    Description

      I have been looking for showing rows and paging through rows. Finally I write this extension to cassandra-cli tool.

      Let's assume that we have the following data in column family named 'CF1':
      =========================
      Row 1:
      key: fdu1, name: 'Frank Du', city: 'NYC'

      Row 2:
      key: fdu2, name: 'Jonathan Ellis'

      Row 3:
      key: fdu3, name: 'Eric Evans'

      Syntax:
      =========================
      LIST keyRangeExpression limitClause?

      keyRangeExpression:
      columnFamilyName[ startKey : endKey ] ( [ 'superCoumnName' ] )?

      limitClause:
      LIMIT count (OFFSET offset)?
      | LIMIT offset, count

      The limit clause is the same with MySql.

      Examples:
      =========================
      // list all the 3 rows in CF1
      list CF1[ '' : '' ]

      // list all rows, offset from index 1. So it will show 2 rows
      list CF1[ '' : '' ] limit 1, 10

      // show the rows 'fdu2' and 'fdu3'
      list CF1[ 'fdu2' : '' ] limit 10

      Attachments

        1. cassandra-cli-list.patch
          10 kB
          James P. Ancona
        2. cassandra-cli-list-1021514.patch
          10 kB
          James P. Ancona
        3. cassandra-no-offset.patch
          9 kB
          James P. Ancona
        4. patch.txt
          7 kB
          Frank Du
        5. path-2010-0602.txt
          9 kB
          Frank Du

        Issue Links

          Activity

            People

              jancona James P. Ancona
              frankdu Frank Du
              James P. Ancona
              Jonathan Ellis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: