| 467 | bool useLosslessTimestamp); |
| 468 | |
| 469 | void readConstantVector( |
| 470 | ByteInputStream* source, |
| 471 | const TypePtr& type, |
| 472 | bolt::memory::MemoryPool* pool, |
| 473 | VectorPtr& result, |
| 474 | vector_size_t resultOffset, |
| 475 | bool useLosslessTimestamp) { |
| 476 | const auto size = source->read<int32_t>(); |
| 477 | std::vector<TypePtr> childTypes = {type}; |
| 478 | std::vector<VectorPtr> children{BaseVector::create(type, 0, pool)}; |
| 479 | readColumns(source, pool, childTypes, children, 0, useLosslessTimestamp); |
| 480 | BOLT_CHECK_EQ(1, children[0]->size()); |
| 481 | |
| 482 | // If there are no previous results, we output this as a constant. RowVectors |
| 483 | // with top-level nulls can have child ConstantVector (even though they can't |
| 484 | // have nulls explicitly set on them), so we don't need to try to apply |
| 485 | // incomingNulls here. |
| 486 | auto constantVector = BaseVector::wrapInConstant(size, 0, children[0]); |
| 487 | |
| 488 | if (resultOffset == 0) { |
| 489 | result = std::move(constantVector); |
| 490 | } else { |
| 491 | result->resize(resultOffset + size); |
| 492 | |
| 493 | SelectivityVector rows(resultOffset + size, false); |
| 494 | rows.setValidRange(resultOffset, resultOffset + size, true); |
| 495 | rows.updateBounds(); |
| 496 | |
| 497 | BaseVector::ensureWritable(rows, type, pool, result); |
| 498 | result->copy(constantVector.get(), resultOffset, 0, size); |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | void readDictionaryVector( |
| 503 | ByteInputStream* source, |
no test coverage detected