sstabledump

Dump the contents of the specified SSTable.

Cassandra tools directory

The default location of the Cassandra tools depends on the type of installation:
  • Package installations: /usr/bin/
  • Tarball installations: installation_location/resources/cassandra/tools/bin

Displays the contents of the specified SSTable to standard output.

To display all table information on the node, first flush the table to disk using nodetool flush before dumping its contents. SStable tools are located in the Cassandra tools directory.

Synopsis

sstabledump [options] sstable_filepath
where the sstable_filepath is /var/lib/cassandra/data.
Tip: SSTable tools work offline from the DataStax Enterprise database. If you need to pass a JVM parameter, specify it in the command line. For example, to change the max heap size:
MAX_HEAP=2g sstabletoolname
-d
Display a CQL row per line.
-e
Display a list of partition keys.
-k key
Limits output to information about the row identified by the specified key.
-x key
Displays all rows except those in the specified partition.

Dump each CQL row

Show a row per line in standard output of the cycling.birthday_list table.
sstabledump /var/lib/cassandra/data/cycling/birthday_list-e439b9222bc511e8891b23da85222d3d/aa-2-bti-Data.db -d
[Claudio HEINEN]@0 Row[info=[ts=1521498957445075] ]:  | , [blist[age]=23 ts=1521498957445075], [blist[bday]=27/07/1992 ts=1521498957445075], [blist[nation]=GERMANY ts=1521498957445075]
[Claudio VANDELLI]@76 Row[info=[ts=1521498957437559] ]:  | , [blist[age]=54 ts=1521498957437559], [blist[bday]=27/07/1961 ts=1521498957437559], [blist[nation]=ITALY ts=1521498957437559]
[Luc HAGENAARS]@152 Row[info=[ts=1521498957448698] ]:  | , [blist[age]=28 ts=1521498957448698], [blist[bday]=27/07/1987 ts=1521498957448698], [blist[nation]=NETHERLANDS ts=1521498957448698]
[Toine POELS]@232 Row[info=[ts=1521498957451068] ]:  | , [blist[age]=52 ts=1521498957451068], [blist[bday]=27/07/1963 ts=1521498957451068], [blist[nation]=NETHERLANDS ts=1521498957451068]
[Allan DAVIS]@310 Row[info=[ts=1521498957430478] ]:  | , [blist[age]=35 ts=1521498957430478], [blist[bday]=27/07/1980 ts=1521498957430478], [blist[nation]=AUSTRALIA ts=1521498957430478]
[Laurence BOURQUE]@384 Row[info=[ts=1521498957441360] ]:  | , [blist[age]=23 ts=1521498957441360], [blist[bday]=27/07/1992 ts=1521498957441360], [blist[nation]=CANADA ts=1521498957441360]

Enumerated partition keys

Display a list of partition keys from the cycling.birthday_list table
sstabledump /var/lib/cassandra/data/cycling/birthday_list-e439b9222bc511e8891b23da85222d3d/aa-2-bti-Data.db -e
[ [ "Claudio HEINEN" ], [ "Claudio VANDELLI" ], [ "Luc HAGENAARS" ], [ "Toine POELS" ], [ "Allan DAVIS" ], [ "Laurence BOURQUE" ]
]

Partition key

Display all rows in the partition:
sstabledump /var/lib/cassandra/data/cycling/birthday_list-e439b9222bc511e8891b23da85222d3d/aa-2-bti-Data.db -k "Claudio HEINEN"
[
  {
    "partition" : {
      "key" : [ "Claudio HEINEN" ],
      "position" : 0
    },
    "rows" : [
      {
        "type" : "row",
        "position" : 75,
        "liveness_info" : { "tstamp" : "2018-03-19T22:35:57.445075Z" },
        "cells" : [
          { "name" : "blist", "path" : [ "age" ], "value" : "23" },
          { "name" : "blist", "path" : [ "bday" ], "value" : "27/07/1992" },
          { "name" : "blist", "path" : [ "nation" ], "value" : "GERMANY" }
        ]
      }
    ]
  }
]

Except partition key

Display all rows except those in the specified partition:
sstabledump /var/lib/cassandra/data/cycling/birthday_list-e439b9222bc511e8891b23da85222d3d/aa-2-bti-Data.db -x "Claudio HEINEN"
[
  {
    "partition" : {
      "key" : [ "Claudio VANDELLI" ],
      "position" : 0
    },
    "rows" : [
      {
        "type" : "row",
        "position" : 151,
        "liveness_info" : { "tstamp" : "2018-03-19T22:35:57.437559Z" },
        "cells" : [
          { "name" : "blist", "path" : [ "age" ], "value" : "54" },
          { "name" : "blist", "path" : [ "bday" ], "value" : "27/07/1961" },
          { "name" : "blist", "path" : [ "nation" ], "value" : "ITALY" }
        ]
      }
    ]
  },
  {
    "partition" : {
      "key" : [ "Luc HAGENAARS" ],
      "position" : 152
    },
    "rows" : [
      {
        "type" : "row",
        "position" : 231,
        "liveness_info" : { "tstamp" : "2018-03-19T22:35:57.448698Z" },
        "cells" : [
          { "name" : "blist", "path" : [ "age" ], "value" : "28" },
          { "name" : "blist", "path" : [ "bday" ], "value" : "27/07/1987" },
          { "name" : "blist", "path" : [ "nation" ], "value" : "NETHERLANDS" }
        ]
      }
    ]
  },
  {
    "partition" : {
      "key" : [ "Toine POELS" ],
      "position" : 232
    },
    "rows" : [
      {
        "type" : "row",
        "position" : 309,
        "liveness_info" : { "tstamp" : "2018-03-19T22:35:57.451068Z" },
        "cells" : [
          { "name" : "blist", "path" : [ "age" ], "value" : "52" },
          { "name" : "blist", "path" : [ "bday" ], "value" : "27/07/1963" },
          { "name" : "blist", "path" : [ "nation" ], "value" : "NETHERLANDS" }
        ]
      }
    ]
  },
  {
    "partition" : {
      "key" : [ "Allan DAVIS" ],
      "position" : 310
    },
    "rows" : [
      {
        "type" : "row",
        "position" : 383,
        "liveness_info" : { "tstamp" : "2018-03-19T22:35:57.430478Z" },
        "cells" : [
          { "name" : "blist", "path" : [ "age" ], "value" : "35" },
          { "name" : "blist", "path" : [ "bday" ], "value" : "27/07/1980" },
          { "name" : "blist", "path" : [ "nation" ], "value" : "AUSTRALIA" }
        ]
      }
    ]
  },
  {
    "partition" : {
      "key" : [ "Laurence BOURQUE" ],
      "position" : 384
    },
    "rows" : [
      {
        "type" : "row",
        "position" : 460,
        "liveness_info" : { "tstamp" : "2018-03-19T22:35:57.441360Z" },
        "cells" : [
          { "name" : "blist", "path" : [ "age" ], "value" : "23" },
          { "name" : "blist", "path" : [ "bday" ], "value" : "27/07/1992" },
          { "name" : "blist", "path" : [ "nation" ], "value" : "CANADA" }
        ]
      }
    ]
  }
]

Each row in JSON format

Display each row in its own JSON map:
sstabledump /var/lib/cassandra/data/cycling/birthday_list-e439b9222bc511e8891b23da85222d3d/aa-2-bti-Data.db -l
{"partition":{"key":["Claudio HEINEN"],"position":0},"rows":[{"type":"row","position":75,"liveness_info":{"tstamp":"2018-03-19T22:35:57.445075Z"},"cells":[{"name":"blist","path":["age"],"value":"23"},{"name":"blist","path":["bday"],"value":"27/07/1992"},{"name":"blist","path":["nation"],"value":"GERMANY"}]}]}
{"partition":{"key":["Claudio VANDELLI"],"position":76},"rows":[{"type":"row","position":151,"liveness_info":{"tstamp":"2018-03-19T22:35:57.437559Z"},"cells":[{"name":"blist","path":["age"],"value":"54"},{"name":"blist","path":["bday"],"value":"27/07/1961"},{"name":"blist","path":["nation"],"value":"ITALY"}]}]}
{"partition":{"key":["Luc HAGENAARS"],"position":152},"rows":[{"type":"row","position":231,"liveness_info":{"tstamp":"2018-03-19T22:35:57.448698Z"},"cells":[{"name":"blist","path":["age"],"value":"28"},{"name":"blist","path":["bday"],"value":"27/07/1987"},{"name":"blist","path":["nation"],"value":"NETHERLANDS"}]}]}
{"partition":{"key":["Toine POELS"],"position":232},"rows":[{"type":"row","position":309,"liveness_info":{"tstamp":"2018-03-19T22:35:57.451068Z"},"cells":[{"name":"blist","path":["age"],"value":"52"},{"name":"blist","path":["bday"],"value":"27/07/1963"},{"name":"blist","path":["nation"],"value":"NETHERLANDS"}]}]}
{"partition":{"key":["Allan DAVIS"],"position":310},"rows":[{"type":"row","position":383,"liveness_info":{"tstamp":"2018-03-19T22:35:57.430478Z"},"cells":[{"name":"blist","path":["age"],"value":"35"},{"name":"blist","path":["bday"],"value":"27/07/1980"},{"name":"blist","path":["nation"],"value":"AUSTRALIA"}]}]}
{"partition":{"key":["Laurence BOURQUE"],"position":384},"rows":[{"type":"row","position":460,"liveness_info":{"tstamp":"2018-03-19T22:35:57.441360Z"},"cells":[{"name":"blist","path":["age"],"value":"23"},{"name":"blist","path":["bday"],"value":"27/07/1992"},{"name":"blist","path":["nation"],"value":"CANADA"}]}]}