-
Notifications
You must be signed in to change notification settings - Fork 232
Set & retrieve field values. #702
Set & retrieve field values. #702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great.
Just one logic change which I think is minor.
frame_test.go
Outdated
t.Fatal("expected change") | ||
} | ||
|
||
// Set value on on same column but different field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate "on" in the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 800e384.
f.mu.Lock() | ||
defer f.mu.Unlock() | ||
|
||
for i := uint(0); i < bitDepth; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For base-2 range-encoding, we only have to store the 0th bit vector, which ends up being the "flip" of the actual value. So if value = 20, base-2 = 10100
and base-2 range-encoded = 01011
. All that to say I think the set and clear here need to be reversed. That would change the logic in FieldValue()
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I fixed the flip in 800e384. I don't quite understand the need for the flip though. Why not store in "unflipped" format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes the range comparisons easier. For example, if you want to find all B greater than F, starting with the most significant bit of a range-encoded bitmap (bits flipped) you can do a NOR
operation:
(range-encoded case where B is definitely greater than F):
B 0 0 1 1
F 0 1 0 1
---------
T - - -
If you store it as the actual value
(equality encoded case where B is definitely greater than F):
B 0 0 1 1
F 0 1 0 1
---------
- - T -
it's not a straightforward bitwise operation.
This commit adds support for set/get field values at the `Frame`, `View`, and `Fragment` levels.
d7efccd
to
800e384
Compare
Overview
This pull request adds support for set/get range values at the
Frame
,View
, andFragment
levels.Fixes #617.
Pull request checklist
Code review checklist
This is the checklist that the reviewer will follow while reviewing your pull request. You do not need to do anything with this checklist, but be aware of what the reviewer will be looking for.