kou commented on code in PR #47200:
URL: https://github.com/apache/arrow/pull/47200#discussion_r2234210475


##########
cpp/src/arrow/io/hdfs_test.cc:
##########
@@ -36,14 +38,27 @@
 #include "arrow/testing/gtest_util.h"
 #include "arrow/testing/util.h"
 
-// boost/filesystem.hpp should be included after
-// arrow/util/windows_compatibility.h because boost/filesystem.hpp
-// includes windows.h implicitly.
-#include <boost/filesystem.hpp>  // NOLINT
-
 namespace arrow {
 namespace io {
 
+std::string RandomPath(const std::string& prefix, int rand_length) {
+  static const char charset[] =
+      "0123456789"
+      "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+      "abcdefghijklmnopqrstuvwxyz";
+  std::string result = prefix;
+  result.reserve(prefix.size() + rand_length);
+
+  std::mt19937 rng(static_cast<unsigned>(std::time(nullptr)));
+  std::uniform_int_distribution<> dist(0, sizeof(charset) - 2);

Review Comment:
   Good point. Then can we move the random string generation part to 
`arrow/testing/util.{c,h}` like other `random_*()`?
   
   `random_path()`? `random_alphabet()`? `random_alnum()`?



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to