Skip to content

Commit

Permalink
Extend join fuzzer to cover group execution mode
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxmeng committed Mar 13, 2024
1 parent 86f559c commit e7bee61
Show file tree
Hide file tree
Showing 7 changed files with 459 additions and 126 deletions.
10 changes: 10 additions & 0 deletions velox/core/PlanFragment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ bool PlanFragment::canSpill(const QueryConfig& queryConfig) const {
}) != nullptr;
}

std::string executionStrategyToString(ExecutionStrategy strategy) {
switch (strategy) {
case ExecutionStrategy::kGrouped:
return "GROUPED";
case ExecutionStrategy::kUngrouped:
return "UNGROUPED";
default:
return fmt::format("UNKNOWN: {}", static_cast<int>(strategy));
}
}
} // namespace facebook::velox::core
2 changes: 2 additions & 0 deletions velox/core/PlanFragment.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ enum class ExecutionStrategy {
kGrouped,
};

std::string executionStrategyToString(ExecutionStrategy strategy);

/// Contains some information on how to execute the fragment of a plan.
/// Used to construct Task.
struct PlanFragment {
Expand Down
11 changes: 11 additions & 0 deletions velox/core/tests/PlanFragmentTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,14 @@ TEST_F(PlanFragmentTest, hashJoin) {
testData.expectedCanSpill);
}
}

TEST_F(PlanFragmentTest, executionStrategyToString) {
ASSERT_EQ(
executionStrategyToString(core::ExecutionStrategy::kUngrouped),
"UNGROUPED");
ASSERT_EQ(
executionStrategyToString(core::ExecutionStrategy::kGrouped), "GROUPED");
ASSERT_EQ(
executionStrategyToString(static_cast<core::ExecutionStrategy>(999)),
"UNKNOWN: 999");
}
Loading

0 comments on commit e7bee61

Please sign in to comment.