Skip to content

Commit

Permalink
Fix spiller types num (#7766)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #7766

Reviewed By: amitkdutta

Differential Revision: D51647028

Pulled By: xiaoxmeng

fbshipit-source-id: 7d478e73fd1de468b697cbcab4ddb2b7550fa5ee
  • Loading branch information
duanmeng authored and facebook-github-bot committed Nov 29, 2023
1 parent c5a4a16 commit 168cda5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions velox/exec/Spiller.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace facebook::velox::exec {
class Spiller {
public:
// Define the spiller types.
enum class Type {
enum class Type : int8_t {
// Used for aggregation input processing stage.
kAggregateInput = 0,
// Used for aggregation output processing stage.
Expand All @@ -37,8 +37,9 @@ class Spiller {
kHashJoinProbe = 3,
// Used for order by.
kOrderBy = 4,
// Number of spiller types.
kNumTypes = 5,
};
static constexpr int kNumTypes = 4;
static std::string typeName(Type);

using SpillRows = std::vector<char*, memory::StlAllocator<char*>>;
Expand Down
5 changes: 3 additions & 2 deletions velox/exec/tests/SpillerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ struct TestParam {
struct TestParamsBuilder {
std::vector<TestParam> getTestParams() {
std::vector<TestParam> params;
for (int i = 0; i < Spiller::kNumTypes; ++i) {
const auto numSpillerTypes = static_cast<int8_t>(Spiller::Type::kNumTypes);
for (int i = 0; i < numSpillerTypes; ++i) {
const auto type = static_cast<Spiller::Type>(i);
if (typesToExclude.find(type) == typesToExclude.end()) {
common::CompressionKind compressionKind =
static_cast<common::CompressionKind>(Spiller::kNumTypes % 6);
static_cast<common::CompressionKind>(numSpillerTypes % 6);
for (int poolSize : {0, 8}) {
params.emplace_back(type, poolSize, compressionKind);
}
Expand Down

0 comments on commit 168cda5

Please sign in to comment.