Skip to content

Commit

Permalink
Extend join fuzzer to cover group execution mode
Browse files Browse the repository at this point in the history
Extend join fuzzer to cover group execution mode. To do this we split the probe and
build input by partitioning on the join keys with one partition per each group. Then we
write the split the inputs into separate files and create table scan splits from the generated
files. For each existing query plan with table scan input, we create a corresponding
grouped execution plan.
Extend AssertQueryBuilder to support group execution configuration.
  • Loading branch information
xiaoxmeng committed Mar 13, 2024
1 parent 86f559c commit 3dcc9a8
Show file tree
Hide file tree
Showing 7 changed files with 468 additions and 130 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 3dcc9a8

Please sign in to comment.