-
Notifications
You must be signed in to change notification settings - Fork 110
Add CDvInfo struct #1286
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
Add CDvInfo struct #1286
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1286 +/- ##
==========================================
- Coverage 83.98% 83.97% -0.02%
==========================================
Files 111 111
Lines 26246 26250 +4
Branches 26246 26250 +4
==========================================
Hits 22044 22044
- Misses 3105 3109 +4
Partials 1097 1097 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
possibly naive question: is another alternative to just make DvInfo
repr(C)
itself? and then could we just keep the bool in there directly? though I suppose that would be some FFI-specific code bleeding in to core kernel so perhaps this is actually better..
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 one quick nit (and I think I answered myself in last comment already)
size: i64, | ||
stats: Option<&Stats>, | ||
dv_info: &DvInfo, | ||
dv_info: &CDvInfo, |
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 we're okay with using stats: Option<&Stats>
, why not just do dv_info: Option<&DvInfo>
?
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 question! Because that would go from a pointer that could not be null to one that could be null, and I felt like that was a more dangerous change that wasn't worth it.
I'd actually consider also not having the stats be allowed to be null in the future too :)
d8a761e
to
07f1d4b
Compare
To answer this, yeah, I'd prefer to keep all the C stuff in the ffi crate |
What changes are proposed in this pull request?
Currently there's no way for a connector using ffi to know if a
&DvInfo
actually has a vector in it. We havehas_vector()
on the rust side, but this isn't exposed via ffi. So this just wraps the&DvInfo
in another struct which includes a boolean that says if there is a dv to consider or not.This allows engines to ignore dv info if there isn't any without needing to make another ffi call at all.
This PR affects the following public APIs
The
CScanCallback
now takes a&CDvInfo
and not a&DvInfo
. This will be a compilation breaker so no risk that engines will silently fail to update to support this change.How was this change tested?
Added a DV test to make sure this works end to end with
read_table