egolearner commented on code in PR #47200: URL: https://github.com/apache/arrow/pull/47200#discussion_r2233715393
########## 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: I'm afraid not. `arrow::random_ascii()` generates ascii character within range `A` to `z`, and `\` is in the range which is unsuitable for path unless properly escaped. -- 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