Wei Deng created CASSANDRA-11694:
------------------------------------

             Summary: sstabledump doesn't represent static columns correctly
                 Key: CASSANDRA-11694
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11694
             Project: Cassandra
          Issue Type: Bug
          Components: Tools
            Reporter: Wei Deng


It appears that the latest trunk code (after fixing CASSANDRA-11654, 
CASSANDRA-11655 and CASSANDRA-11656) of sstabledump still doesn't handle static 
columns correctly.

Take a look at the following example:

{noformat}
root@node0:/mnt/ephemeral/cassandra/data/testks/test_static_column-ab5ce7c20b8411e695aeebb3bfdd5790#
 ~/cassandra-trunk/tools/bin/sstabledump ma-1-big-Data.db -t
[
  {
    "partition" : {
      "key" : [ "1" ],
      "position" : 0
    },
    "rows" : [
      {
        "type" : "static_block",
        "position" : 40,
        "cells" : [
          { "name" : "static0_int", "value" : "3000", "tstamp" : 
"1461657675565767" },
          { "name" : "static1_int", "value" : "4000", "tstamp" : 
"1461657675565767" }
        ]
      },
      {
        "type" : "row",
        "position" : 40,
        "clustering" : [ "c1" ],
        "liveness_info" : { "tstamp" : "1461657663393419" },
        "cells" : [
          { "name" : "val0_int", "value" : "100" },
          { "name" : "val1_set_of_int", "deletion_info" : { "marked_deleted" : 
"1461657663393418", "local_delete_time" : "1461657663" } },
          { "name" : "val1_set_of_int", "path" : [ "1" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "2" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "3" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "4" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "5" ], "value" : "" }
        ]
      },
      {
        "type" : "row",
        "position" : 92,
        "clustering" : [ "c2" ],
        "liveness_info" : { "tstamp" : "1461657675565767" },
        "cells" : [
          { "name" : "val0_int", "value" : "200" },
          { "name" : "val1_set_of_int", "deletion_info" : { "marked_deleted" : 
"1461657675565766", "local_delete_time" : "1461657675" } },
          { "name" : "val1_set_of_int", "path" : [ "1" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "2" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "3" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "4" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "5" ], "value" : "" }
        ]
      },
      {
        "type" : "row",
        "position" : 144,
        "clustering" : [ "c3" ],
        "liveness_info" : { "tstamp" : "1461657634639043" },
        "cells" : [
          { "name" : "val0_int", "value" : "300" },
          { "name" : "val1_set_of_int", "deletion_info" : { "marked_deleted" : 
"1461657634639042", "local_delete_time" : "1461657634" } },
          { "name" : "val1_set_of_int", "path" : [ "1" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "2" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "3" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "4" ], "value" : "" },
          { "name" : "val1_set_of_int", "path" : [ "5" ], "value" : "" }
        ]
      }
    ]
  }
]
{noformat}

Note the "position" for the "static_block" and the first "row" are the same 
(40), which should be incorrect.

If you print out in debug mode, you will see the following:

{noformat}
root@node0:/mnt/ephemeral/cassandra/data/testks/test_static_column-ab5ce7c20b8411e695aeebb3bfdd5790#
 ~/cassandra-trunk/tools/bin/sstabledump ma-1-big-Data.db -t -d
[1]@0 Row[info=[ts=-9223372036854775808] ]: STATIC | [static0_int=3000 
ts=1461657675565767], [static1_int=4000 ts=1461657675565767]
[1]@0 Row[info=[ts=1461657663393419] ]: c1 | [val0_int=100 
ts=1461657663393419], del(val1_set_of_int)=deletedAt=1461657663393418, 
localDeletion=1461657663, [val1_set_of_int[1]= ts=1461657663393419], 
[val1_set_of_int[2]= ts=1461657663393419], [val1_set_of_int[3]= 
ts=1461657663393419], [val1_set_of_int[4]= ts=1461657663393419], 
[val1_set_of_int[5]= ts=1461657663393419]
[1]@92 Row[info=[ts=1461657675565767] ]: c2 | [val0_int=200 
ts=1461657675565767], del(val1_set_of_int)=deletedAt=1461657675565766, 
localDeletion=1461657675, [val1_set_of_int[1]= ts=1461657675565767], 
[val1_set_of_int[2]= ts=1461657675565767], [val1_set_of_int[3]= 
ts=1461657675565767], [val1_set_of_int[4]= ts=1461657675565767], 
[val1_set_of_int[5]= ts=1461657675565767]
[1]@144 Row[info=[ts=1461657634639043] ]: c3 | [val0_int=300 
ts=1461657634639043], del(val1_set_of_int)=deletedAt=1461657634639042, 
localDeletion=1461657634, [val1_set_of_int[1]= ts=1461657634639043], 
[val1_set_of_int[2]= ts=1461657634639043], [val1_set_of_int[3]= 
ts=1461657634639043], [val1_set_of_int[4]= ts=1461657634639043], 
[val1_set_of_int[5]= ts=1461657634639043]
{noformat}

There are three problems in this "-d" output:

1. It printed an invalid timestamp "ts=-9223372036854775808".
2. It printed "@0" twice at the beginning, which should be impossible.
3. It doesn't print "CellPath" component for the collection, which is 
important, collection type like "set" will only put its element in the Cell 
Path so if you don't print that you're missing some information in the output.

So there are a total of four issues we need to fix when dealing with static 
columns.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to