pitrou commented on a change in pull request #7507:
URL: https://github.com/apache/arrow/pull/7507#discussion_r576995343



##########
File path: cpp/src/arrow/array/util.cc
##########
@@ -74,11 +75,222 @@ class ArrayDataWrapper {
   std::shared_ptr<Array>* out_;
 };
 
+class ArrayDataEndianSwapper {
+ public:
+  ArrayDataEndianSwapper(const std::shared_ptr<ArrayData>& data, int64_t 
length)
+      : data_(data), length_(length) {
+    const std::shared_ptr<DataType>& type = data->type;
+    std::vector<std::shared_ptr<Buffer>> buffers(data->buffers.size(), 
nullptr);
+    std::vector<std::shared_ptr<ArrayData>> 
child_data(data->child_data.size(), nullptr);
+    out_ = ArrayData::Make(type, data->length, buffers, child_data, 
data->null_count, 0);

Review comment:
       Now that I'm thinking of it, you can probably write `out_ = 
data->Copy();` instead.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to