| 167 | |
| 168 | template <TypeKind kind> |
| 169 | static VectorPtr |
| 170 | addSequence(BufferPtr lengths, vector_size_t size, VectorPtr vector) { |
| 171 | auto base = vector.get(); |
| 172 | auto pool = base->pool(); |
| 173 | auto lsize = lengths->size(); |
| 174 | return std::make_shared< |
| 175 | SequenceVector<typename KindToFlatVector<kind>::WrapperType>>( |
| 176 | pool, |
| 177 | size, |
| 178 | std::move(vector), |
| 179 | std::move(lengths), |
| 180 | SimpleVectorStats<typename KindToFlatVector<kind>::WrapperType>{}, |
| 181 | std::nullopt /*distinctCount*/, |
| 182 | std::nullopt, |
| 183 | false /*sorted*/, |
| 184 | base->representedBytes().has_value() |
| 185 | ? std::optional<ByteCount>( |
| 186 | base->representedBytes().value() * size / |
| 187 | (1 + (lsize / sizeof(vector_size_t)))) |
| 188 | : std::nullopt); |
| 189 | } |
| 190 | |
| 191 | // static |
| 192 | VectorPtr BaseVector::wrapInSequence( |