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

sstabledump displays incorrect value for "position" key

    XMLWordPrintableJSON

    Details

      Description

      When partitions with multiple rows are displayed using sstabledump, the "position" value the first row of each partition is incorrect.

      For example:

      sstabledump mc-1-big-Data.db
      [
        {
          "partition" : {
            "key" : [ "1", "24" ],
            "position" : 0
          },
          "rows" : [
            {
              "type" : "row",
              "position" : 66, 
              "clustering" : [ "2013-12-10 00:00:00.000Z" ],
              "liveness_info" : { "tstamp" : "2018-09-12T05:01:09.290086Z" },
              "cells" : [
                { "name" : "centigrade", "value" : 8 },
                { "name" : "chanceofrain", "value" : 0.1 },
                { "name" : "feelslike", "value" : 8 },
                { "name" : "humidity", "value" : 0.76 },
                { "name" : "wind", "value" : 10.0 }
              ]
            },
            {
              "type" : "row",
              "position" : 66, 
              "clustering" : [ "2013-12-11 00:00:00.000Z" ],
              "liveness_info" : { "tstamp" : "2018-09-12T05:01:09.295369Z" },
              "cells" : [
                { "name" : "centigrade", "value" : 4 },
                { "name" : "chanceofrain", "value" : 0.3 },
                { "name" : "feelslike", "value" : 4 },
                { "name" : "humidity", "value" : 0.9 },
                { "name" : "wind", "value" : 12.0 }
              ]
            },
            {
              "type" : "row",
              "position" : 105,
              "clustering" : [ "2013-12-12 00:00:00.000Z" ],
              "liveness_info" : { "tstamp" : "2018-09-12T05:01:09.300841Z" },
              "cells" : [
                { "name" : "centigrade", "value" : 3 },
                { "name" : "chanceofrain", "value" : 0.2 },
                { "name" : "feelslike", "value" : 3 },
                { "name" : "humidity", "value" : 0.68 },
                { "name" : "wind", "value" : 6.0 }
              ]
            }
          ]
        }
      ]
      

       The expected output is:

      [
        {
          "partition" : {
            "key" : [ "1", "24" ],
            "position" : 0
          },
          "rows" : [
            {
              "type" : "row",
              "position" : 28,
              "clustering" : [ "2013-12-10 00:00:00.000Z" ],
              "liveness_info" : { "tstamp" : "2018-09-12T05:01:09.290086Z" },
              "cells" : [
                { "name" : "centigrade", "value" : 8 },
                { "name" : "chanceofrain", "value" : 0.1 },
                { "name" : "feelslike", "value" : 8 },
                { "name" : "humidity", "value" : 0.76 },
                { "name" : "wind", "value" : 10.0 }
              ]
            },
            {
              "type" : "row",
              "position" : 66,
              "clustering" : [ "2013-12-11 00:00:00.000Z" ],
              "liveness_info" : { "tstamp" : "2018-09-12T05:01:09.295369Z" },
              "cells" : [
                { "name" : "centigrade", "value" : 4 },
                { "name" : "chanceofrain", "value" : 0.3 },
                { "name" : "feelslike", "value" : 4 },
                { "name" : "humidity", "value" : 0.9 },
                { "name" : "wind", "value" : 12.0 }
              ]
            },
            {
              "type" : "row",
              "position" : 105,
              "clustering" : [ "2013-12-12 00:00:00.000Z" ],
              "liveness_info" : { "tstamp" : "2018-09-12T05:01:09.300841Z" },
              "cells" : [
                { "name" : "centigrade", "value" : 3 },
                { "name" : "chanceofrain", "value" : 0.2 },
                { "name" : "feelslike", "value" : 3 },
                { "name" : "humidity", "value" : 0.68 },
                { "name" : "wind", "value" : 6.0 }
              ]
            }
          ]
        }
      ]
      

        Attachments

        1. cassandra-dump.patch
          3 kB
          Cameron Zemek

          Activity

            People

            • Assignee:
              cam1982 Cameron Zemek
              Reporter:
              Damien Stevenson Damien Stevenson
              Authors:
              Cameron Zemek
              Reviewers:
              Chris Lohfink, Michael Semb Wever
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: