-
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 ManagedQuery
usage in SOMAArray
write path
#2989
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2989 +/- ##
==========================================
+ Coverage 89.64% 89.79% +0.14%
==========================================
Files 39 39
Lines 4096 4096
==========================================
+ Hits 3672 3678 +6
+ Misses 424 418 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
a8705ef
to
ea4dec5
Compare
ea4dec5
to
37dadf5
Compare
ManagedQuery
in write pathmalloc
with ManagedQuery
in write path
malloc
with ManagedQuery
in write pathManagedQuery
usage in SOMAArray
write path
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 a well-organized PR, easy to review and easy for everyone to understand later. Thank you!!
There are a couple items here, both of which can be follow-on PRs if you like.
I will move the bit to uin8_t conversion method and do the extend enumeration fix in two separate follow up PRs. |
Issue and/or context:
#2928
Changes:
Commits should be viewed individually. Although much of this code already existed prior to this PR, there were enough modifications that the changes were too noisy to read clearly.
ManagedQuery::setup_write_column
takes in a column name, number of elements, and pointers to buffers that contain the passed in data. This use to be three separate calls toManagedQuery::setup_column_data
,ColumnBuffer::set_data
, andManagedQuery::set_column_data
but now simplifiedSOMAArray::set_array_data
made a copy of the passed inArrowTable
and then passed the casted buffers toColumnBuffer::set_data
. We now iterate through each column callingSOMAArray::_cast_column
, which casts the values into temporary vectors and the passes thestd::vector::data()
pointer intoManagedQuery::setup_write_column
SOMAArray::_cast_column
handles all permutations of attributes with or without enumerations and columns with or without dictionaries.SOMAArray::_promote_indexes_to_values
which maps the dictionary's indexes to the associated dictionary values and passes that dictionary value mapping vector intoManagedQuery::setup_write_column
SOMAArray::_cast_column_aux
for further processingSOMAArray::_promote_indexes_to_values
callsSOMAArray::_cast_dictionary_values
. It retrieves the dictionary's indexes viaSOMAArray::_get_index_vector
and then iterates through the index vector and maps and casts to the correct dictionary valueSOMAArray::_cast_column_aux
callsSOMAArray::_set_column
.ManagedQuery::setup_write_buffer
SOMAArray::_extend_enumeration
callsSOMAArray::_extend_and_evolve_schema
which check if any new enumerations have been introducedSOMAArray::_remap_indexes
which callsSOMAArray::_remap_indexes_aux
to iterate through the original indexes and shift them to match the new extended enumeration on-disk.SOMAArray::_cast_shifted_indexes
casts the shifted index values to the type on disk and passes this intoManagedQuery::setup_write_buffer
ManagedQuery::setup_write_column
vector<uint8_t>
of Boolean mappings instead of casting inplace