wesm commented on code in PR #13364:
URL: https://github.com/apache/arrow/pull/13364#discussion_r895067171
##########
cpp/src/arrow/array/data.cc:
##########
@@ -128,6 +131,143 @@ int64_t ArrayData::GetNullCount() const {
return precomputed;
}
+// ----------------------------------------------------------------------
+// Methods for ArraySpan
+
+void ArraySpan::SetMembers(const ArrayData& data) {
+ this->type = data.type.get();
+ this->length = data.length;
+ this->null_count = data.null_count.load();
+ this->offset = data.offset;
+
+ for (size_t i = 0; i < data.buffers.size(); ++i) {
+ const std::shared_ptr<Buffer>& buffer = data.buffers[i];
+ // It is the invoker-of-kernels's responsibility to ensure that
+ // const buffers are not written to accidentally.
+ if (buffer) {
+ SetBuffer(i, buffer);
+ } else {
+ ClearBuffer(i);
+ }
+ }
+
+ // Makes sure any other buffers are seen as null / non-existent
+ for (size_t i = data.buffers.size(); i < 3; ++i) {
+ ClearBuffer(i);
+ }
+
+ // TODO(wesm): what about extension arrays?
Review Comment:
I removed this comment, which was worrying for nothing
--
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]