Skip to content

Commit

Permalink
Extend join fuzzer to cover group execution mode (facebookincubator#9045
Browse files Browse the repository at this point in the history
)

Summary:
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.

Pull Request resolved: facebookincubator#9045

Reviewed By: mbasmanova

Differential Revision: D54792224

Pulled By: xiaoxmeng

fbshipit-source-id: 79824df01a5468a4ebbd63316c1a046c3d4b92a1
  • Loading branch information
xiaoxmeng authored and Joe-Abraham committed Jun 7, 2024
1 parent f3f7946 commit 3e67ce2
Show file tree
Hide file tree
Showing 7 changed files with 511 additions and 160 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 3e67ce2

Please sign in to comment.