-
Notifications
You must be signed in to change notification settings - Fork 465
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
adapter/storage: Cast MySQL bit
columns to uint8
, add convience functions
#31097
base: main
Are you sure you want to change the base?
Conversation
677e43e
to
f994fae
Compare
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.
LGTM, but I think we should add docs for the new functions.
src/adapter/BUILD.bazel
Outdated
@@ -24,7 +24,6 @@ rust_library( | |||
compile_data = [], | |||
crate_features = ["default"], | |||
data = [], | |||
disable_pipelining = True, |
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.
Did you mean to include this in this PR? It seems a bit unrelated.
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.
I didn't was rebased on the wrong branch by accident, removed!
.get(byte_index) | ||
.map(|b| (*b >> bit_index) & 1) | ||
.ok_or(err)?; | ||
Ok(Datum::from(i32::from(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.
If I'm understanding correctly, the following might be useful: assert!(i == 0 || i == 1)
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.
Good call!
Good idea, I'll add them in a separate PR though so we can merge them when v0.131 goes out |
f2485a9
to
67c8301
Compare
bit
columns to bytea
, add convience functionsbit
columns to uint8
, add convience functions
67c8301
to
e6b3ef2
Compare
e6b3ef2
to
99fad97
Compare
This PR changes the MySQL source to support ingesting the
bit
type asuint8
. It also adds two new Postgres functions,bit_count(bytea)
andget_bit(bytea, int32)
to making working with byte strings easier.Motivation
Progress towards: https://github.com/MaterializeInc/database-issues/issues/8891
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.