| 33 | } |
| 34 | |
| 35 | void RowTableEncoder::PrepareKeyColumnArrays(int64_t start_row, int64_t num_rows, |
| 36 | const std::vector<KeyColumnArray>& cols_in) { |
| 37 | const auto num_cols = static_cast<uint32_t>(cols_in.size()); |
| 38 | DCHECK(batch_all_cols_.size() == num_cols); |
| 39 | |
| 40 | uint32_t num_varbinary_visited = 0; |
| 41 | for (uint32_t i = 0; i < num_cols; ++i) { |
| 42 | const KeyColumnArray& col = cols_in[row_metadata_.column_order[i]]; |
| 43 | KeyColumnArray col_window = col.Slice(start_row, num_rows); |
| 44 | |
| 45 | batch_all_cols_[i] = col_window; |
| 46 | if (!col.metadata().is_fixed_length) { |
| 47 | DCHECK(num_varbinary_visited < batch_varbinary_cols_.size()); |
| 48 | // If start row is zero, then base offset of varbinary column is also zero. |
| 49 | if (start_row == 0) { |
| 50 | batch_varbinary_cols_base_offsets_[num_varbinary_visited] = 0; |
| 51 | } else { |
| 52 | batch_varbinary_cols_base_offsets_[num_varbinary_visited] = |
| 53 | col.offsets()[start_row]; |
| 54 | } |
| 55 | batch_varbinary_cols_[num_varbinary_visited++] = col_window; |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void RowTableEncoder::DecodeFixedLengthBuffers(int64_t start_row_input, |
| 61 | int64_t start_row_output, int64_t num_rows, |