| 425 | } |
| 426 | |
| 427 | void FactorizedTable::copyUnflatVectorToFlatColumn(const ValueVector& vector, |
| 428 | const BlockAppendingInfo& blockAppendInfo, uint64_t numAppendedTuples, ft_col_idx_t colIdx) { |
| 429 | auto byteOffsetOfColumnInTuple = tableSchema.getColOffset(colIdx); |
| 430 | auto dstTuple = blockAppendInfo.data; |
| 431 | if (vector.state->getSelVector().isUnfiltered()) { |
| 432 | if (vector.hasNoNullsGuarantee()) { |
| 433 | for (auto i = 0u; i < blockAppendInfo.numTuplesToAppend; i++) { |
| 434 | vector.copyToRowData(numAppendedTuples + i, dstTuple + byteOffsetOfColumnInTuple, |
| 435 | inMemOverflowBuffer.get()); |
| 436 | dstTuple += tableSchema.getNumBytesPerTuple(); |
| 437 | } |
| 438 | } else { |
| 439 | for (auto i = 0u; i < blockAppendInfo.numTuplesToAppend; i++) { |
| 440 | if (vector.isNull(numAppendedTuples + i)) { |
| 441 | setNonOverflowColNull(dstTuple + tableSchema.getNullMapOffset(), colIdx); |
| 442 | } else { |
| 443 | vector.copyToRowData(numAppendedTuples + i, |
| 444 | dstTuple + byteOffsetOfColumnInTuple, inMemOverflowBuffer.get()); |
| 445 | } |
| 446 | dstTuple += tableSchema.getNumBytesPerTuple(); |
| 447 | } |
| 448 | } |
| 449 | } else { |
| 450 | if (vector.hasNoNullsGuarantee()) { |
| 451 | for (auto i = 0u; i < blockAppendInfo.numTuplesToAppend; i++) { |
| 452 | vector.copyToRowData(vector.state->getSelVector()[numAppendedTuples + i], |
| 453 | dstTuple + byteOffsetOfColumnInTuple, inMemOverflowBuffer.get()); |
| 454 | dstTuple += tableSchema.getNumBytesPerTuple(); |
| 455 | } |
| 456 | } else { |
| 457 | for (auto i = 0u; i < blockAppendInfo.numTuplesToAppend; i++) { |
| 458 | auto pos = vector.state->getSelVector()[numAppendedTuples + i]; |
| 459 | if (vector.isNull(pos)) { |
| 460 | setNonOverflowColNull(dstTuple + tableSchema.getNullMapOffset(), colIdx); |
| 461 | } else { |
| 462 | vector.copyToRowData(pos, dstTuple + byteOffsetOfColumnInTuple, |
| 463 | inMemOverflowBuffer.get()); |
| 464 | } |
| 465 | dstTuple += tableSchema.getNumBytesPerTuple(); |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | // For an unflat column, only an unflat vector is allowed to copy from, for the column, we only |
| 472 | // store an overflow_value_t, which contains a pointer to the overflow dataBlock in the |
nothing calls this directly
no test coverage detected