-
Notifications
You must be signed in to change notification settings - Fork 245
DRIVERS-3123 Require ignored bits in BSON binary vector PACKED_BITS to be zero. #1783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
c13784b
2d9565d
f270a25
d7ccb03
ea265ea
87f75e1
9461d62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -184,6 +184,7 @@ Drivers MUST validate vector metadata and raise an error if any invariant is vio | |
|
|
||
| - Padding MUST be 0 for all dtypes where padding doesn’t apply, and MUST be within \[0, 7\] for PACKED_BIT. | ||
| - A PACKED_BIT vector MUST NOT be empty if padding is in the range \[1, 7\]. | ||
| - For a PACKED_BIT vector, bits lower than the given padding (those ignored) must be zero. | ||
|
||
| - When unpacking binary data into a FLOAT32 Vector structure, the length of the binary data following the dtype and | ||
| padding MUST be a multiple of 4 bytes. | ||
kevinAlbs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,30 +14,39 @@ | |||||
| { | ||||||
| "description": "Simple Vector PACKED_BIT", | ||||||
| "valid": true, | ||||||
| "vector": [127, 7], | ||||||
| "vector": [127, 8], | ||||||
kevinAlbs marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| "dtype_hex": "0x10", | ||||||
| "dtype_alias": "PACKED_BIT", | ||||||
| "padding": 0, | ||||||
| "canonical_bson": "1600000005766563746F7200040000000910007F0700" | ||||||
| "canonical_bson": "1600000005766563746F7200040000000910007F0800" | ||||||
|
||||||
| "canonical_bson": "1600000005766563746F7200040000000910007F0800" | |
| "canonical_bson": "1600000005766563746F7200040000000910007F0700" |
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 what it's worth, it could be helpful adding some specificity about bit order here since the description is correct only if bits are interpreted in the opposite order used for packed_bit encoding. (packed_bit is otherwise MSB first, but this is referring to the LSB as 0)
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.
Happy to. Would you please suggest a short alternative? Any longer description that you'd like to make should be done in a new PR.
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.
Suggest rewording to avoid "lower":
I expect the phrase "The least-significant bits are ignored." above clarifies which bits are ignored.
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.
Thanks @kevinAlbs. Updated.