TODO: Rommel Use randomeString from StringUtil
| 8 | |
| 9 | //TODO: Rommel Use randomeString from StringUtil |
| 10 | std::string randomString(std::size_t length) { |
| 11 | const std::string characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
| 12 | |
| 13 | std::random_device random_device; |
| 14 | std::mt19937 generator(random_device()); |
| 15 | std::uniform_int_distribution<> distribution(0, characters.size() - 1); |
| 16 | |
| 17 | std::string random_string; |
| 18 | |
| 19 | for(std::size_t i = 0; i < length; ++i) { |
| 20 | random_string += characters[distribution(generator)]; |
| 21 | } |
| 22 | |
| 23 | return random_string; |
| 24 | } |
| 25 | |
| 26 | CacheDataLocalFile::CacheDataLocalFile(std::unique_ptr<ral::frame::BlazingTable> table, std::string orc_files_path, std::string ctx_token) |
| 27 | : CacheData(CacheDataType::LOCAL_FILE, table->names(), table->get_schema(), table->num_rows()) |