From 0bec5fd0e3f42d53cb3e4e615b4cc84fa1112718 Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Mon, 8 Apr 2024 14:02:24 +0800 Subject: [PATCH] Fix compile --- velox/functions/sparksql/tests/StringTest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/velox/functions/sparksql/tests/StringTest.cpp b/velox/functions/sparksql/tests/StringTest.cpp index 900abcab3d9e..6042bf9bdbfc 100644 --- a/velox/functions/sparksql/tests/StringTest.cpp +++ b/velox/functions/sparksql/tests/StringTest.cpp @@ -21,6 +21,17 @@ namespace facebook::velox::functions::sparksql::test { namespace { +std::string generateRandomString(size_t length) { + const std::string chars = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + std::string randomString; + for (std::size_t i = 0; i < length; ++i) { + randomString += chars[folly::Random::rand32() % chars.size()]; + } + return randomString; +} + class StringTest : public SparkFunctionBaseTest { protected: // This is a five codepoint sequence that renders as a single emoji.