| 172 | info) { return info.param.testName; }); |
| 173 | |
| 174 | TEST_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 | |
| 199 | TEST_P(PeeledEncodingBasicTests, someCommonDictionaryLayers) { |
| 200 | LocalDecodedVector localDecodedVector(execCtx_); |
nothing calls this directly
no test coverage detected