kiszk commented on a change in pull request #7555:
URL: https://github.com/apache/arrow/pull/7555#discussion_r450287754
##########
File path: cpp/src/arrow/ipc/test_common.cc
##########
@@ -79,6 +79,39 @@ Status MakeRandomInt32Array(int64_t length, bool
include_nulls, MemoryPool* pool
return Status::OK();
}
+template <typename ArrayType>
+static Status MakeRandomArray(int64_t length, bool include_nulls, MemoryPool*
pool,
+ std::shared_ptr<Array>* out, uint32_t seed) {
+ random::RandomArrayGenerator rand(seed);
+ const double null_probability = include_nulls ? 0.5 : 0.0;
+
+ *out = rand.Numeric<ArrayType>(length, 0, 1000, null_probability);
+
+ return Status::OK();
+}
+
+template <>
+Status MakeRandomArray<Int8Type>(int64_t length, bool include_nulls,
MemoryPool* pool,
Review comment:
To make this static cause the compilation error. I will put them into
the anonymous namespace.
```
/home/ishizaki/Arrow/arrow/cpp/src/arrow/ipc/test_common.cc:94:1: error:
explicit template specialization cannot have a storage class
static Status MakeRandomArray<Int8Type>(int64_t length, bool include_nulls,
MemoryPool* pool,
^~~~~~
```
----------------------------------------------------------------
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]