Its a little hard to tell which line is 33, but it looks like the problem is that get_range
yields two values, but your block is only taking the first one. If you only care about the row keys and not the columns then you should use get_range_keys
.
It looks like you do in fact care about the column values because you fetch them out again using db.multi_get
. This is an unnecessary additional query. You can update your code to something like:
db.get_range(:user_tags, :batch_size => 10000) do |id, columns|
tags = tag_counts_from_row(columns)
puts "#{id} - #{tags.inspect}"
end