-
Notifications
You must be signed in to change notification settings - Fork 85
Support writes outside of head partition #23
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #23 +/- ##
==========================================
+ Coverage 63.14% 66.34% +3.21%
==========================================
Files 17 19 +2
Lines 594 909 +315
==========================================
+ Hits 375 603 +228
- Misses 169 215 +46
- Partials 50 91 +41
Continue to review full report at Codecov.
|
hi @nakabonne , let me know what you think :) |
Thank you @dpgil! I will get back as soon as possible 👍 |
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.
Great approach and example tests! Mostly LGTM except for a couple of nitpicks comments!
storage_examples_test.go
Outdated
defer func() { | ||
if err := storage.Close(); err != nil { | ||
panic(err) | ||
} | ||
}() |
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 is unneeded because the first one will get closed at L623
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 catch
storage_examples_test.go
Outdated
defer func() { | ||
if err := storage.Close(); err != nil { | ||
panic(err) | ||
} | ||
}() |
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 is unneeded as well
storage.go
Outdated
if len(rowsToInsert) == 0 { | ||
return nil | ||
} | ||
if !iterator.next() { | ||
return nil | ||
} |
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.
nit: Currently it's fine, but break
makes more sense than the early return. To avoid future confusion, let's use it.
if len(rowsToInsert) == 0 { | |
return nil | |
} | |
if !iterator.next() { | |
return nil | |
} | |
if len(rowsToInsert) == 0 { | |
break | |
} | |
if !iterator.next() { | |
break | |
} |
@nakabonne thank you for the feedback! i made the requested changes |
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 approach.
Thank you! |
v0.2.1 with this change got released. Thank you for your contribution! |
currently we only write to the head partition, this change supports writing to any of the writable partitions (currently set to 2).
ref #20