hbase-ruby icon indicating copy to clipboard operation
hbase-ruby copied to clipboard

timestamps

Open cambridgemike opened this issue 15 years ago • 1 comments

Perhaps I'm misunderstanding something, but timestamps are not working the way I would expect them to

client.create_row("my_table","key1", Time.now.to_i, [{:name=>"name", :value=>"value"}])

row = client.show_row("my_table","key1") => #<HBase::Model::Row:0x105e2ce98 @name="key1", @columns=[#<HBase::Model::Column:0x105e2d028 @name="name", @timestamp=1262699564874, @value="value">], @timestamp=nil, @table_name="my_table", @total_count=0>

Time.at(row.columns.first.timestamp) => Wed May 11 02:07:54 -0500 41983

From the source I don't see where this column timestamp gets set, and I'm confused as to why the row timestamp is nil

cambridgemike avatar Jan 05 '10 14:01 cambridgemike

Hm, I didn't catch this in the Row model when I was updating the project. Either way, HBase::Model::Row should not have the attribute "timestamp" associated to it. Timestamps exist only at the column level (HBase::Model::Column), and this is from the design of BigTable. In the next update of hbase-ruby, I'll be removing the timestamp attribute from the Row model.

If you're curious as to where the timestamp is getting set on the Column objects, it's on line 28 of lib/hbase/response/row_response.rb.

greglu avatar Jan 05 '10 18:01 greglu