You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kevingurney (via GitHub)" <gi...@apache.org> on 2023/05/25 17:49:11 UTC

[GitHub] [arrow] kevingurney commented on a diff in pull request #35655: GH-35598: [MATLAB] Add a public `Valid` property to to the `MATLAB arrow.array.` classes to query Null values (i.e. validity bitmap support)

kevingurney commented on code in PR #35655:
URL: https://github.com/apache/arrow/pull/35655#discussion_r1205840940


##########
matlab/src/cpp/arrow/matlab/array/proxy/numeric_array.h:
##########
@@ -26,11 +26,19 @@
 #include "arrow/type_traits.h"
 
 #include "arrow/matlab/array/proxy/array.h"
+#include "arrow/matlab/bit/bit_pack_matlab_logical_array.h"
 
 #include "libmexclass/proxy/Proxy.h"
 
 namespace arrow::matlab::array::proxy {
 
+namespace {
+const uint8_t* getUnpackedValidityBitmap(const ::matlab::data::TypedArray<bool>& valid_elements) {
+    const auto valid_elements_iterator(valid_elements.cbegin());
+    return reinterpret_cast<const uint8_t*>(valid_elements_iterator.operator->());

Review Comment:
   Unfortunately, the current design of the MATLAB Data APIs doesn't provide an easier way of extracting the raw data without making a copy. The `->operator()` syntax is the only way to achieve this at the moment.
   
   We know this isn't a great solution, and we have reached out to the relevant product teams at MathWorks to see if we can come up with a better solution for a future MATLAB release.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org