Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ class BroadcastTest : public exec::test::OperatorTestBase {

auto tempDirectoryPath = exec::test::TempDirectoryPath::create();
auto [serdeRowType, broadcastFilePaths] =
executeBroadcastWrite(data, tempDirectoryPath->path, serdeLayout);
executeBroadcastWrite(data, tempDirectoryPath->getPath(), serdeLayout);

// Expect one file for each request.
ASSERT_EQ(broadcastFilePaths.size(), 1);

// Validate file path prefix is consistent.
ASSERT_EQ(broadcastFilePaths.back().find(tempDirectoryPath->path), 0);
ASSERT_EQ(broadcastFilePaths.back().find(tempDirectoryPath->getPath()), 0);

// Read back broadcast data from broadcast file.
auto result = readFromFile(broadcastFilePaths.back(), serdeRowType);
Expand All @@ -184,7 +184,7 @@ class BroadcastTest : public exec::test::OperatorTestBase {

// Read back result.
auto [broadcastReadCursor, broadcastReadResults] = executeBroadcastRead(
serdeRowType, tempDirectoryPath->path, broadcastFilePaths);
serdeRowType, tempDirectoryPath->getPath(), broadcastFilePaths);

// Assert its same as data.
velox::exec::test::assertEqualResults(expected, broadcastReadResults);
Expand Down Expand Up @@ -268,14 +268,14 @@ TEST_F(BroadcastTest, endToEndWithNoRows) {
std::vector<std::string> broadcastFilePaths;

// Execute write.
auto results = executeBroadcastWrite({data}, tempDirectoryPath->path);
auto results = executeBroadcastWrite({data}, tempDirectoryPath->getPath());

// Assert no file path returned.
ASSERT_EQ(broadcastFilePaths.size(), 0);

auto fileSystem =
velox::filesystems::getFileSystem(tempDirectoryPath->path, nullptr);
auto files = fileSystem->list(tempDirectoryPath->path);
velox::filesystems::getFileSystem(tempDirectoryPath->getPath(), nullptr);
auto files = fileSystem->list(tempDirectoryPath->getPath());

// Assert no file was generated in broadcast directory path.
ASSERT_EQ(files.size(), 0);
Expand All @@ -297,14 +297,14 @@ TEST_F(BroadcastTest, endToEndWithMultipleWriteNodes) {
// Execute write.
for (auto data : dataVector) {
auto [serdeRowType, results] =
executeBroadcastWrite({data}, tempDirectoryPath->path);
executeBroadcastWrite({data}, tempDirectoryPath->getPath());
broadcastFilePaths.emplace_back(results[0]);
}

// Read back result.
auto [taskCursorReadNode, broadcastReadResults] = executeBroadcastRead(
asRowType(dataVector[0]->type()),
tempDirectoryPath->path,
tempDirectoryPath->getPath(),
broadcastFilePaths);

// Validate BroadcastExchange reads back output of both writes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ class UnsafeRowShuffleTest : public exec::test::OperatorTestBase {
// Create a local file system storage based shuffle.
velox::filesystems::registerLocalFileSystem();
auto rootDirectory = velox::exec::test::TempDirectoryPath::create();
auto rootPath = rootDirectory->path;
auto rootPath = rootDirectory->getPath();
const std::string shuffleWriteInfo =
localShuffleWriteInfo(rootPath, numPartitions);

Expand Down Expand Up @@ -979,7 +979,7 @@ TEST_F(UnsafeRowShuffleTest, persistentShuffle) {
// Create a local file system storage based shuffle.
velox::filesystems::registerLocalFileSystem();
auto rootDirectory = velox::exec::test::TempDirectoryPath::create();
auto rootPath = rootDirectory->path;
auto rootPath = rootDirectory->getPath();

auto data = makeRowVector({
makeFlatVector<int32_t>({1, 2, 3, 4, 5, 6}),
Expand Down
30 changes: 16 additions & 14 deletions presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ class TaskManagerTest : public testing::Test {
protocol::TaskSource source;
source.planNodeId = sourceId;
for (auto& filePath : filePaths) {
source.splits.emplace_back(makeSplit(filePath->path, splitSequenceId++));
source.splits.emplace_back(
makeSplit(filePath->getPath(), splitSequenceId++));
}
source.noMoreSplits = noMoreSplits;
return source;
Expand Down Expand Up @@ -571,15 +572,16 @@ class TaskManagerTest : public testing::Test {
static std::shared_ptr<exec::test::TempDirectoryPath> setupSpillPath() {
auto spillDirectory = exec::test::TempDirectoryPath::create();
auto sysConfigFilePath =
fmt::format("{}/config.properties", spillDirectory->path);
fmt::format("{}/config.properties", spillDirectory->getPath());
auto fileSystem = filesystems::getFileSystem(sysConfigFilePath, nullptr);
auto sysConfigFile = fileSystem->openFileForWrite(sysConfigFilePath);
SystemConfig::instance()->setValue(
std::string(SystemConfig::kSpillerSpillPath), spillDirectory->path);
std::string(SystemConfig::kSpillerSpillPath),
spillDirectory->getPath());
sysConfigFile->close();

auto nodeConfigFilePath =
fmt::format("{}/node.properties", spillDirectory->path);
fmt::format("{}/node.properties", spillDirectory->getPath());
auto nodeConfigFile = fileSystem->openFileForWrite(nodeConfigFilePath);
nodeConfigFile->append(fmt::format(
"{}={}\n{}={}",
Expand Down Expand Up @@ -647,7 +649,7 @@ TEST_F(TaskManagerTest, tableScanAllSplitsAtOnce) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (int i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}
duckDbQueryRunner_.createTable("tmp", vectors);

Expand All @@ -673,7 +675,7 @@ TEST_F(TaskManagerTest, fecthFromFinishedTask) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (int i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}
duckDbQueryRunner_.createTable("tmp", vectors);

Expand Down Expand Up @@ -790,7 +792,7 @@ TEST_F(TaskManagerTest, taskCleanupWithPendingResultData) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (int i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}

auto planFragment = exec::test::PlanBuilder()
Expand Down Expand Up @@ -845,7 +847,7 @@ TEST_F(TaskManagerTest, tableScanOneSplitAtATime) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (int i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}
duckDbQueryRunner_.createTable("tmp", vectors);

Expand Down Expand Up @@ -879,7 +881,7 @@ TEST_F(TaskManagerTest, tableScanMultipleTasks) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (int i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}
duckDbQueryRunner_.createTable("tmp", vectors);

Expand Down Expand Up @@ -954,7 +956,7 @@ TEST_F(TaskManagerTest, countAggregation) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (int i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}
duckDbQueryRunner_.createTable("tmp", vectors);

Expand All @@ -967,7 +969,7 @@ TEST_F(TaskManagerTest, distributedSort) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (int i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}
duckDbQueryRunner_.createTable("tmp", vectors);

Expand Down Expand Up @@ -1039,7 +1041,7 @@ TEST_F(TaskManagerTest, outOfQueryUserMemory) {
auto filePaths = makeFilePaths(5);
auto vectors = makeVectors(filePaths.size(), 1'000);
for (auto i = 0; i < filePaths.size(); i++) {
writeToFile(filePaths[i]->path, vectors[i]);
writeToFile(filePaths[i]->getPath(), vectors[i]);
}
duckDbQueryRunner_.createTable("tmp", vectors);

Expand Down Expand Up @@ -1161,7 +1163,7 @@ TEST_F(TaskManagerTest, aggregationSpill) {
}
std::vector<RowVectorPtr> vectors;
for (int i = 0; i < filePaths.size(); ++i) {
writeToFile(filePaths[i]->path, batches[i]);
writeToFile(filePaths[i]->getPath(), batches[i]);
std::move(
batches[i].begin(), batches[i].end(), std::back_inserter(vectors));
}
Expand All @@ -1177,7 +1179,7 @@ TEST_F(TaskManagerTest, aggregationSpill) {
int32_t spillPct{0};
if (doSpill) {
spillDirectory = TaskManagerTest::setupSpillPath();
taskManager_->setBaseSpillDirectory(spillDirectory->path);
taskManager_->setBaseSpillDirectory(spillDirectory->getPath());
spillPct = 100;
queryConfigs.emplace(core::QueryConfig::kSpillEnabled, "true");
queryConfigs.emplace(core::QueryConfig::kAggregationSpillEnabled, "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ TEST_F(PlanConverterTest, batchPlanConversion) {
" \"rootPath\": \"{}\",\n"
" \"numPartitions\": {}\n"
"}}",
exec::test::TempDirectoryPath::create()->path,
exec::test::TempDirectoryPath::create()->getPath(),
10)),
std::make_shared<std::string>("/tmp"));

Expand Down