-
Notifications
You must be signed in to change notification settings - Fork 25
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
[c++] Fix bug with sliced Arrow-table writes, with string columns #3433
Conversation
2356f18
to
faf5071
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3433 +/- ##
==========================================
+ Coverage 86.03% 86.27% +0.24%
==========================================
Files 55 55
Lines 6278 6295 +17
==========================================
+ Hits 5401 5431 +30
+ Misses 877 864 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
if (array->n_buffers == 3) { | ||
buf = (UserType*)array->buffers[2] + array->offset; | ||
} else { | ||
buf = (UserType*)array->buffers[1] + array->offset; | ||
} | ||
uint8_t* validity = (uint8_t*)array->buffers[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.
Nit: This would be a good opportunity to move away from the C-style cast to a named cast (static_cast
in this case).
// * Whether the column (array) has 3 buffers (validity, offset, data) | ||
// or 2 (validity, data). |
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 found this comment confusing since we throw if the column (array) doesn't have 3 buffers.
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: There is a lot of C-style casting in this code which isn't a big deal, but is a little harder to read and little more error prone that more specific cast.
) (#3436) Co-authored-by: John Kerl <[email protected]>
Issue and/or context: #3432 [sc-60767]
Changes:
As described on #3432.
Also, an existing test-case, that might have caught the problem sooner but did not, did not test string columns. That has been modified to also test string columns.
Notes for Reviewer: