Skip to content

Commit

Permalink
xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
kewang1024 committed May 1, 2024
1 parent c201a36 commit e195b4f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion velox/common/file/FileSystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class LocalFileSystem : public FileSystem {

virtual std::vector<std::string> listFolders(std::string_view path) override {
std::vector<std::string> folders;
for (auto& p : std::filesystem::recursive_directory_iterator(extractPath(path))) {
for (auto& p : std::filesystem::recursive_directory_iterator(extractPath(
path))) {
if (p.is_directory())
folders.push_back(p.path().string());
}
Expand Down
4 changes: 2 additions & 2 deletions velox/common/file/tests/FaultyFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ std::unique_ptr<ReadFile> FaultyFileSystem::openFileForRead(
const FileOptions& options) {
const std::string delegatedPath = std::string(extractPath(path));
auto delegatedFile = getFileSystem(delegatedPath, config_)
->openFileForRead(delegatedPath, options);
->openFileForRead(delegatedPath, options);
return std::make_unique<FaultyReadFile>(
std::string(path), std::move(delegatedFile), [&](FaultFileOperation* op) {
maybeInjectFileFault(op);
Expand All @@ -70,7 +70,7 @@ std::unique_ptr<WriteFile> FaultyFileSystem::openFileForWrite(
const FileOptions& options) {
const std::string delegatedPath = std::string(extractPath(path));
auto delegatedFile = getFileSystem(delegatedPath, config_)
->openFileForWrite(delegatedPath, options);
->openFileForWrite(delegatedPath, options);
return std::make_unique<FaultyWriteFile>(
std::string(path), std::move(delegatedFile), [&](FaultFileOperation* op) {
maybeInjectFileFault(op);
Expand Down
3 changes: 2 additions & 1 deletion velox/common/file/tests/FileTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ TEST_P(LocalFileTest, listFolders) {
localFs->remove(dir2_1);
localFs->remove(dir2);
localFs->remove(dir3);
ASSERT_TRUE(localFs->listFolders(std::string_view(tempFolder->getPath())).empty());
ASSERT_TRUE(
localFs->listFolders(std::string_view(tempFolder->getPath())).empty());
}

TEST_P(LocalFileTest, readFileDestructor) {
Expand Down
6 changes: 4 additions & 2 deletions velox/exec/fuzzer/WriterFuzzerRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
namespace facebook::velox::exec::test {

/// WriterFuzzerRunner leverages WriterFuzzer and VectorFuzzer to
/// automatically generate and execute table writer tests. It works in following steps:
/// automatically generate and execute table writer tests.
/// It works in following steps:
///
/// 1. Pick different table write properties. Eg: partitioned. (TODO: bucketed, sorted).
/// 1. Pick different table write properties. Eg: partitioned.
/// (TODO: bucketed, sorted).
/// 2. Generate corresponding table write query plan.
/// 3. Generate a random set of input data (vector).
/// 4. Execute the query plan.
Expand Down
10 changes: 6 additions & 4 deletions velox/functions/prestosql/fuzzer/WriterFuzzerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ int main(int argc, char** argv) {
using Runner = facebook::velox::exec::test::WriterFuzzerRunner;
using PrestoQueryRunner = facebook::velox::exec::test::PrestoQueryRunner;

VELOX_CHECK(!FLAGS_presto_url.empty(), "Table writer fuzzer only supports presto DB for now")
auto queryRunner = std::make_unique<PrestoQueryRunner>(FLAGS_presto_url,
"writer_fuzzer",
static_cast<std::chrono::milliseconds>(FLAGS_req_timeout_ms));
VELOX_CHECK(!FLAGS_presto_url.empty(),
"Table writer fuzzer only supports presto DB for now")
auto queryRunner = std::make_unique<PrestoQueryRunner>(
FLAGS_presto_url,
"writer_fuzzer",
static_cast<std::chrono::milliseconds>(FLAGS_req_timeout_ms));
LOG(INFO) << "Using Presto as the reference DB.";
return Runner::run(
initialSeed,
Expand Down

0 comments on commit e195b4f

Please sign in to comment.