Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

BSI Range-Encoding: internal support for setting field values #617

Closed
travisturner opened this issue Jun 7, 2017 · 0 comments · Fixed by #702
Closed

BSI Range-Encoding: internal support for setting field values #617

travisturner opened this issue Jun 7, 2017 · 0 comments · Fixed by #702
Assignees

Comments

@travisturner
Copy link
Member

travisturner commented Jun 7, 2017

Given a frame, columnID, field, and value, look up the field in the schema for the frame and set the appropriate bits for the field (probably need to set both 1's and 0's)

In the example in #616, the following function:

frame.setFieldValue(colID uint64, field string, val int64) {}

called with:

setFieldValue(1, "age", 35)

Would perform the equivalent of the following (note that we are setting the flip of 35 in 7-bit binary (0100011 to 1011100):

SetBit(frame="f", columnID=1, rowID=0)
ClearBit(frame="f", columnID=1, rowID=1)
ClearBit(frame="f", columnID=1, rowID=2)
SetBit(frame="f", columnID=1, rowID=3)
SetBit(frame="f", columnID=1, rowID=4)
SetBit(frame="f", columnID=1, rowID=5)
ClearBit(frame="f", columnID=1, rowID=6)
SetBit(frame="f", columnID=1, rowID=7)

We should be aware that by having val be an int64 we are limiting ourselves to 64-bit range-encoded values when technically we don't have a limit with the implementation.

A basic POC can be found at https://github.com/travisturner/bit-slice-index

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants