JabariBooker commented on a change in pull request #12014:
URL: https://github.com/apache/arrow/pull/12014#discussion_r794900959



##########
File path: cpp/src/arrow/testing/random.cc
##########
@@ -182,6 +188,9 @@ static std::shared_ptr<NumericArray<ArrowType>> 
GenerateNumericArray(int64_t siz
 
   buffers[1] = *AllocateBuffer(sizeof(CType) * size);
   options.GenerateData(buffers[1]->mutable_data(), size);
+  if (std::is_same<ArrowType, Date64Type>::value) {
+    GenerateFullDayMillisNoNan(buffers[1]->mutable_data(), size);
+  }

Review comment:
       This is intentional. Since we need to generate multiples of 86400000 for 
`Date64Type`, random numbers are generated in `GenerateData` and ultimately 
multiplied by 86400000 in 
[`GenerateFullDayMillisNoNan`](https://github.com/JabariBooker/arrow/blob/ARROW-10924/cpp/src/arrow/testing/random.cc#L172).
 The behavior of `GenerateFullDayMillisNoNan` is separated from 
`GenerateOptions` since this class doesn't know the arrow type, only the 
underlying C type. However, behavior of `GenerateFullDayMillisNoNan` could be 
moved into the above `if` statement if needed.




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


Reply via email to