| 282 | } |
| 283 | |
| 284 | VectorPtr readFlatVector( |
| 285 | const TypePtr& type, |
| 286 | vector_size_t size, |
| 287 | std::istream& in, |
| 288 | memory::MemoryPool* pool) { |
| 289 | // Nulls buffer. |
| 290 | BufferPtr nulls = readOptionalBuffer(in, pool); |
| 291 | |
| 292 | // Values buffer. |
| 293 | BufferPtr values = readOptionalBuffer(in, pool); |
| 294 | |
| 295 | // String buffers. |
| 296 | std::vector<BufferPtr> stringBuffers; |
| 297 | if (type->isVarchar() || type->isVarbinary()) { |
| 298 | int32_t numStringBuffers = read<int32_t>(in); |
| 299 | for (auto i = 0; i < numStringBuffers; ++i) { |
| 300 | stringBuffers.push_back(readBuffer(in, pool)); |
| 301 | } |
| 302 | |
| 303 | // Update the pointers in the StringViews. |
| 304 | if (values) { |
| 305 | restoreVectorStringViews(size, values, stringBuffers); |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | return BOLT_DYNAMIC_SCALAR_TYPE_DISPATCH_ALL( |
| 310 | createFlat, type->kind(), type, size, pool, nulls, values, stringBuffers); |
| 311 | } |
| 312 | |
| 313 | template <TypeKind kind> |
| 314 | void writeScalarConstant(const BaseVector& vector, std::ostream& out) { |
no test coverage detected