@@ -54,15 +54,30 @@ class TestRuntimeStatWriter : public BaseRuntimeStatWriter {
54
54
} // namespace
55
55
56
56
struct TestParam {
57
- common::CompressionKind compressionKind;
58
- bool enablePrefixSort;
57
+ const common::CompressionKind compressionKind;
58
+ const bool enablePrefixSort;
59
59
60
60
TestParam (common::CompressionKind _compressionKind, bool _enablePrefixSort)
61
61
: compressionKind(_compressionKind),
62
62
enablePrefixSort (_enablePrefixSort) {}
63
+
64
+ TestParam (uint32_t value)
65
+ : compressionKind(static_cast <common::CompressionKind>(value >> 1 )),
66
+ enablePrefixSort(!!(value & 1 )) {}
67
+
68
+ uint32_t value () const {
69
+ return static_cast <uint32_t >(compressionKind) << 1 | enablePrefixSort;
70
+ }
71
+
72
+ std::string toString () const {
73
+ return fmt::format (
74
+ " compressionKind: {}, enablePrefixSort: {}" ,
75
+ compressionKind,
76
+ enablePrefixSort);
77
+ }
63
78
};
64
79
65
- class SpillTest : public ::testing::TestWithParam<common::CompressionKind >,
80
+ class SpillTest : public ::testing::TestWithParam<uint32_t >,
66
81
public facebook::velox::test::VectorTestBase {
67
82
public:
68
83
explicit SpillTest ()
@@ -75,13 +90,33 @@ class SpillTest : public ::testing::TestWithParam<common::CompressionKind>,
75
90
setThreadLocalRunTimeStatWriter (nullptr );
76
91
}
77
92
78
- static std::vector<common::CompressionKind> getTestParams () {
79
- std::vector<common::CompressionKind> testParams;
80
- testParams.emplace_back (common::CompressionKind::CompressionKind_NONE);
81
- testParams.emplace_back (common::CompressionKind::CompressionKind_ZLIB);
82
- testParams.emplace_back (common::CompressionKind::CompressionKind_SNAPPY);
83
- testParams.emplace_back (common::CompressionKind::CompressionKind_ZSTD);
84
- testParams.emplace_back (common::CompressionKind::CompressionKind_LZ4);
93
+ static std::vector<uint32_t > getTestParams () {
94
+ std::vector<uint32_t > testParams;
95
+ testParams.emplace_back (
96
+ TestParam{common::CompressionKind::CompressionKind_NONE, false }
97
+ .value ());
98
+ testParams.emplace_back (
99
+ TestParam{common::CompressionKind::CompressionKind_ZLIB, false }
100
+ .value ());
101
+ testParams.emplace_back (
102
+ TestParam{common::CompressionKind::CompressionKind_SNAPPY, false }
103
+ .value ());
104
+ testParams.emplace_back (
105
+ TestParam{common::CompressionKind::CompressionKind_ZSTD, false }
106
+ .value ());
107
+ testParams.emplace_back (
108
+ TestParam{common::CompressionKind::CompressionKind_LZ4, false }.value ());
109
+ testParams.emplace_back (
110
+ TestParam{common::CompressionKind::CompressionKind_NONE, true }.value ());
111
+ testParams.emplace_back (
112
+ TestParam{common::CompressionKind::CompressionKind_ZLIB, true }.value ());
113
+ testParams.emplace_back (
114
+ TestParam{common::CompressionKind::CompressionKind_SNAPPY, true }
115
+ .value ());
116
+ testParams.emplace_back (
117
+ TestParam{common::CompressionKind::CompressionKind_ZSTD, true }.value ());
118
+ testParams.emplace_back (
119
+ TestParam{common::CompressionKind::CompressionKind_LZ4, true }.value ());
85
120
return testParams;
86
121
}
87
122
@@ -103,8 +138,8 @@ class SpillTest : public ::testing::TestWithParam<common::CompressionKind>,
103
138
tempDir_ = exec::test::TempDirectoryPath::create ();
104
139
filesystems::registerLocalFileSystem ();
105
140
rng_.seed (1 );
106
- compressionKind_ = GetParam ();
107
- enablePrefixSort_ = true ;
141
+ compressionKind_ = TestParam{ GetParam ()}. compressionKind ;
142
+ enablePrefixSort_ = TestParam{ GetParam ()}. enablePrefixSort ;
108
143
}
109
144
110
145
uint8_t randPartitionBitOffset () {
0 commit comments