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

Deleting and re-inserting row causes error in get_slice count parameter

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.6.1
    • None
    • None
    • Mac OS/ Java 6

    • Low

    Description

      I've found that when I delete an entire row in a column family with super columns, and then re-insert values with the same row and super column keys, the count parameter to the get_slice call no longer works properly. Its like it is still counting the deleted columns, but only returning the new columns.

      The following example uses the Ruby Cassandra client (see link below), but I've seen the same behavior with the Java Thrift interface.

      Test code:
      --------------
      require 'rubygems'
      require 'cassandra'
      cc = Cassandra.new('Keyspace1')
      cc.insert(:Super1,'test-key1',{'bucket1' => {'1' => 'Item 1', '2' => 'Item 2', '5' => 'Item 5'}})
      items = cc.get(:Super1,'test-key1','bucket1')
      puts "returned #

      {items.size} items, should be 3"
      cc.remove(:Super1,'test-key1')
      items = cc.get(:Super1,'test-key1','bucket1')
      puts "returned #{items.size}

      items, should be 0"
      cc.insert(:Super1,'test-key1',{'bucket1' => {'3' => 'Item 3', '4' => 'Item 4', '6' => 'Item 6'}})
      items = cc.get(:Super1,'test-key1','bucket1')
      puts "returned #

      {items.size} items, should be 3"
      items = cc.get(:Super1,'test-key1','bucket1',:count => 3)
      puts "returned #{items.size}

      items, should be 3"
      items = cc.get(:Super1,'test-key1','bucket1',:count => 4)
      puts "returned #

      {items.size} items, should be 3"
      items = cc.get(:Super1,'test-key1','bucket1',:count => 5)
      puts "returned #{items.size}

      items, should be 3"
      items = cc.get(:Super1,'test-key1','bucket1',:count => 6)
      puts "returned #

      {items.size}

      items, should be 3"

      Output:
      returned 3 items, should be 3
      returned 0 items, should be 0
      returned 3 items, should be 3
      returned 1 items, should be 3
      returned 2 items, should be 3
      returned 2 items, should be 3
      returned 3 items, should be 3

      Ruby library link:
      http://blog.evanweaver.com/files/doc/fauna/cassandra/files/README_rdoc.html

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            brandon.williams Brandon Williams Assign to me
            bflorian Bob Florian
            Brandon Williams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment