kou commented on code in PR #35655:
URL: https://github.com/apache/arrow/pull/35655#discussion_r1206011015
##########
matlab/src/cpp/arrow/matlab/array/proxy/array.cc:
##########
@@ -40,4 +43,25 @@ namespace arrow::matlab::array::proxy {
auto length_mda = factory.createScalar(array->length());
context.outputs[0] = length_mda;
}
+
+ void Array::valid(libmexclass::proxy::method::Context& context) {
+ size_t array_length = static_cast<size_t>(array->length());
Review Comment:
```suggestion
auto array_length = static_cast<size_t>(array->length());
```
##########
matlab/src/cpp/arrow/matlab/bit/bit_unpack_arrow_buffer.cc:
##########
@@ -0,0 +1,41 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/matlab/bit/bit_unpack_arrow_buffer.h"
+
+#include "arrow/util/bitmap_visit.h"
+
+namespace arrow::matlab::bit {
+ ::matlab::data::TypedArray<bool> bitUnpackArrowBuffer(const
std::shared_ptr<arrow::Buffer>& packed_buffer, int64_t length) {
+ const uint8_t* packed_buffer_ptr = packed_buffer->data();
+
+ ::matlab::data::ArrayFactory factory;
+
+ const size_t array_length = static_cast<size_t>(length);
Review Comment:
```suggestion
const auto array_length = static_cast<size_t>(length);
```
##########
matlab/src/cpp/arrow/matlab/bit/bit_unpack_arrow_buffer.cc:
##########
@@ -0,0 +1,41 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "arrow/matlab/bit/bit_unpack_arrow_buffer.h"
+
+#include "arrow/util/bitmap_visit.h"
+
+namespace arrow::matlab::bit {
+ ::matlab::data::TypedArray<bool> bitUnpackArrowBuffer(const
std::shared_ptr<arrow::Buffer>& packed_buffer, int64_t length) {
+ const uint8_t* packed_buffer_ptr = packed_buffer->data();
Review Comment:
```suggestion
const auto packed_buffer_ptr = packed_buffer->data();
```
##########
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:
I see.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]