Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Fix Version/s: None
    • Component/s: Tools
    • Labels:

      Description

      While a useful tool for education and simple tests, cassandra-cli is ultimately limted by the fact that column names and values are binary, (and eventually keys will be as well, see CASSANDRA-767).

      The current approach when writing consists of encoding column names as UTF8, and passing the value as a byte[] of the String parsed from the command. When performing a read, the column names outputted are the result of the toString() method of the comparator (the result of which is not always meaningful), and values are again treated as raw strings. This is almost certainly broken anywhere that the CF comparator is not UTF8Type and values are anything but strings.

      One possible approach would be to follow HBase's lead and simply allow binary values to be encoded as strings (see: http://wiki.apache.org/hadoop/Hbase/Shell).

      1. CASSANDRA-912-2.patch.txt
        24 kB
        Sean Bridges
      2. CASSANDRA-912.patch
        24 kB
        Sean Bridges

        Issue Links

          Activity

          Hide
          Jonathan Ellis added a comment -

          Pavel has been making excellent progress on this. (For binary data in particular, see CASSANDRA-1603.)

          Show
          Jonathan Ellis added a comment - Pavel has been making excellent progress on this. (For binary data in particular, see CASSANDRA-1603 .)
          Hide
          Sean Bridges added a comment -

          rebased previous patch to trunk

          Show
          Sean Bridges added a comment - rebased previous patch to trunk
          Hide
          Matthew F. Dennis added a comment -

          can you rebase the patch please? it no longer applies cleanly on trunk...

          Show
          Matthew F. Dennis added a comment - can you rebase the patch please? it no longer applies cleanly on trunk...
          Hide
          Sean Bridges added a comment -

          This patch allows using binary constants of the form 0x[pairs of hex digits] for keys,col,supercol and values. For example,

          set Super1[0xCA][0xFE][0xBA] = 0xBE

          To be consistent, binary column names and values are also printed as 0x[pairs of hex digits].

          Show
          Sean Bridges added a comment - This patch allows using binary constants of the form 0x [pairs of hex digits] for keys,col,supercol and values. For example, set Super1 [0xCA] [0xFE] [0xBA] = 0xBE To be consistent, binary column names and values are also printed as 0x [pairs of hex digits] .
          Hide
          Jeremy Hanna added a comment - - edited

          maybe one of the cassandra clients could be made into a contrib module and include a nice way to use it as a shell... perhaps one that several regular committers/contributors are adequately familiar with so that it doesn't become stale on the cassandra mainline.

          Show
          Jeremy Hanna added a comment - - edited maybe one of the cassandra clients could be made into a contrib module and include a nice way to use it as a shell... perhaps one that several regular committers/contributors are adequately familiar with so that it doesn't become stale on the cassandra mainline.
          Hide
          Stu Hood added a comment -

          +1 on the idea of tearing out the current CLI and replacing it with a dynamic language shell, possibly with a blessed Thrift wrapper client imported.

          Show
          Stu Hood added a comment - +1 on the idea of tearing out the current CLI and replacing it with a dynamic language shell, possibly with a blessed Thrift wrapper client imported.
          Hide
          Jonathan Ellis added a comment -

          Along those lines, a javascript shell by Matt Mastracci: http://code.google.com/p/cassandra-shell/

          Show
          Jonathan Ellis added a comment - Along those lines, a javascript shell by Matt Mastracci: http://code.google.com/p/cassandra-shell/
          Hide
          Ben Standefer added a comment -

          I've been using the Python interactive shell + pycassa as a mock cassandra-cli. Is this along the lines of the Cassandra-remote on steroids idea? Basically an excellent implementation of the Thrift/Cassandra API in an interactive interface?

          Show
          Ben Standefer added a comment - I've been using the Python interactive shell + pycassa as a mock cassandra-cli. Is this along the lines of the Cassandra-remote on steroids idea? Basically an excellent implementation of the Thrift/Cassandra API in an interactive interface?
          Hide
          Jonathan Ellis added a comment - - edited

          Replacing the existing cli entirely with something like Cassandra-remote on steroids (http://wiki.apache.org/cassandra/ThriftInterface) is also an option.

          Show
          Jonathan Ellis added a comment - - edited Replacing the existing cli entirely with something like Cassandra-remote on steroids ( http://wiki.apache.org/cassandra/ThriftInterface ) is also an option.
          Hide
          Jonathan Ellis added a comment -

          If you like Antlr or want to learn it, this is the right place to start.

          Show
          Jonathan Ellis added a comment - If you like Antlr or want to learn it, this is the right place to start.

            People

            • Assignee:
              Unassigned
              Reporter:
              Eric Evans
            • Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development