Returns a one element ArrayVector with 'vector' as elements of array at 0.
| 185 | |
| 186 | // Returns a one element ArrayVector with 'vector' as elements of array at 0. |
| 187 | VectorPtr asArray(VectorPtr vector) { |
| 188 | BufferPtr sizes = AlignedBuffer::allocate<vector_size_t>( |
| 189 | 1, vector->pool(), vector->size()); |
| 190 | BufferPtr offsets = |
| 191 | AlignedBuffer::allocate<vector_size_t>(1, vector->pool(), 0); |
| 192 | return std::make_shared<ArrayVector>( |
| 193 | vector->pool(), |
| 194 | ARRAY(vector->type()), |
| 195 | BufferPtr(nullptr), |
| 196 | 1, |
| 197 | offsets, |
| 198 | sizes, |
| 199 | vector, |
| 200 | 0); |
| 201 | } |
| 202 | |
| 203 | /// Splits input vector into 'n' vectors evenly. Input vector must have at |
| 204 | /// least 'n' rows. |
no test coverage detected