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

Fix usage instructions about sstabledump -k and -x options

    XMLWordPrintableJSON

Details

    Description

      The options -k and -x of sstabledump admit multiple arguments, so users can include or exclude multiple partitions. The intended usage is, for example:

      $ sstablepartitions <sstable_path> -k 1
      $ sstablepartitions <sstable_path> -k 1 2 3
      

      However, the following command will fail:

      $ sstablepartitions -k 1 <sstable_path>
      You must supply exactly one sstable
      usage: sstabledump <sstable file path> <options>
      
      Dump contents of given SSTable to standard output in JSON format.
       -d         CQL row per line internal representation
       -e         enumerate partition keys only
       -k <arg>   Partition key
       -t         Print raw timestamps instead of iso8601 date strings
       -x <arg>   Excluded partition key
      

      This command fails because the sstable path is considered a fourth partition key, and the mandatory argument for the sstable path is missed. While I think this behaviour is correct, it can be a bit confusing for users, especially when the information about usage describes both -k and -x as single-argument.

      I think that at least we should fix the description of the options to indicate that there could be multiple included/excluded keys, and probably improve the message about the missing sstable path when those options are used.

      Alternatively we could modify the options to have a single argument and allow to repeat them, so we could accept things like:

      $ sstablepartitions -k 1 <sstable_path>
      $ sstablepartitions -k 1 -k 2 -k 3 <sstable_path>
      $ sstablepartitions <sstable_path> -k 1 -k 2 -k 3
      

      The main downside of the latter approach is that the change in the syntax of the command might cause compatibility issues. Also we would need to upgrade commons-cli to at least 1.2 due to CLI-137.

      Attachments

        Issue Links

          Activity

            People

              adelapena Andres de la Peña
              adelapena Andres de la Peña
              Andres de la Peña
              Berenguer Blasi, Ekaterina Dimitrova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m