MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_P

Function TEST_P

bolt/expression/tests/PeeledEncodingTest.cpp:174–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172 info) { return info.param.testName; });
173
174TEST_P(PeeledEncodingBasicTests, allCommonDictionaryLayers) {
175 LocalDecodedVector localDecodedVector(execCtx_);
176 const SelectivityVector& rows = GetParam().rows;
177 // 1. Common dictionary layers are peeled
178 // Input Vectors: Dict1(Dict2(Flat1)), Dict1(Dict2(Const1)),
179 // Dict1(Dict2(Dict3(Flat2)))
180 // Peeled Vectors: Flat, Const1, Dict3(Flat2)
181 // Peel: Dict1(Dict2) => collapsed into one dictionary
182
183 auto input1 = wrapInDictionaryLayers(flat1, {&dictWrap2, &dictWrap1});
184 auto input2 = wrapInDictionaryLayers(const1, {&dictWrap2, &dictWrap1});
185 auto input3 =
186 wrapInDictionaryLayers(flat2, {&dictWrap3, &dictWrap2, &dictWrap1});
187 std::vector<VectorPtr> peeledVectors;
188 auto peeledEncoding = PeeledEncoding::peel(
189 {input1, input2, input3}, rows, localDecodedVector, true, peeledVectors);
190 ASSERT_EQ(peeledVectors.size(), 3);
191 ASSERT_EQ(peeledEncoding->wrapEncoding(), VectorEncoding::Simple::DICTIONARY);
192 ASSERT_EQ(peeledVectors[0].get(), flat1.get());
193 ASSERT_EQ(peeledVectors[1].get(), const1.get());
194 ASSERT_EQ(peeledVectors[2].get(), peelWrappings(2, input3).get());
195 assertEqualVectors(
196 input1, peeledEncoding->wrap(flat1->type(), pool(), flat1, rows), rows);
197}
198
199TEST_P(PeeledEncodingBasicTests, someCommonDictionaryLayers) {
200 LocalDecodedVector localDecodedVector(execCtx_);

Callers

nothing calls this directly

Calls 14

ARRAYFunction · 0.85
fuzzNotNullMethod · 0.80
wrapInLazyVectorMethod · 0.80
translateToInnerRowsMethod · 0.80
assertEqualVectorsFunction · 0.50
poolFunction · 0.50
sizeMethod · 0.45
wrapEncodingMethod · 0.45
getMethod · 0.45
wrapMethod · 0.45
typeMethod · 0.45
encodingMethod · 0.45

Tested by

no test coverage detected