| 284 | } |
| 285 | |
| 286 | void RowArray::DecodeFixedLength(ResizableArrayData* output, int output_start_row, |
| 287 | int column_id, uint32_t fixed_length, |
| 288 | int num_rows_to_append, const uint32_t* row_ids) const { |
| 289 | switch (fixed_length) { |
| 290 | case 0: |
| 291 | RowArrayAccessor::Visit(rows_, column_id, num_rows_to_append, row_ids, |
| 292 | [&](int i, const uint8_t* ptr, uint32_t num_bytes) { |
| 293 | bit_util::SetBitTo(output->mutable_data(1), |
| 294 | output_start_row + i, *ptr != 0); |
| 295 | }); |
| 296 | break; |
| 297 | case 1: |
| 298 | RowArrayAccessor::Visit(rows_, column_id, num_rows_to_append, row_ids, |
| 299 | [&](int i, const uint8_t* ptr, uint32_t num_bytes) { |
| 300 | output->mutable_data(1)[output_start_row + i] = *ptr; |
| 301 | }); |
| 302 | break; |
| 303 | case 2: |
| 304 | RowArrayAccessor::Visit( |
| 305 | rows_, column_id, num_rows_to_append, row_ids, |
| 306 | [&](int i, const uint8_t* ptr, uint32_t num_bytes) { |
| 307 | output->mutable_data_as<uint16_t>(1)[output_start_row + i] = |
| 308 | *reinterpret_cast<const uint16_t*>(ptr); |
| 309 | }); |
| 310 | break; |
| 311 | case 4: |
| 312 | RowArrayAccessor::Visit( |
| 313 | rows_, column_id, num_rows_to_append, row_ids, |
| 314 | [&](int i, const uint8_t* ptr, uint32_t num_bytes) { |
| 315 | output->mutable_data_as<uint32_t>(1)[output_start_row + i] = |
| 316 | *reinterpret_cast<const uint32_t*>(ptr); |
| 317 | }); |
| 318 | break; |
| 319 | case 8: |
| 320 | RowArrayAccessor::Visit( |
| 321 | rows_, column_id, num_rows_to_append, row_ids, |
| 322 | [&](int i, const uint8_t* ptr, uint32_t num_bytes) { |
| 323 | output->mutable_data_as<uint64_t>(1)[output_start_row + i] = |
| 324 | *reinterpret_cast<const uint64_t*>(ptr); |
| 325 | }); |
| 326 | break; |
| 327 | default: |
| 328 | RowArrayAccessor::Visit( |
| 329 | rows_, column_id, num_rows_to_append, row_ids, |
| 330 | [&](int i, const uint8_t* ptr, uint32_t num_bytes) { |
| 331 | uint64_t* dst = reinterpret_cast<uint64_t*>( |
| 332 | output->mutable_data(1) + num_bytes * (output_start_row + i)); |
| 333 | const uint64_t* src = reinterpret_cast<const uint64_t*>(ptr); |
| 334 | // Note that both `output` and `ptr` have been allocated with enough padding |
| 335 | // to accommodate the memory overshoot. See the allocations for |
| 336 | // `ResizableArrayData` in `JoinResultMaterialize` and `JoinResidualFilter` |
| 337 | // for `output`, and `RowTableImpl::kPaddingForVectors` for `ptr`. |
| 338 | for (uint32_t word_id = 0; |
| 339 | word_id < bit_util::CeilDiv(num_bytes, sizeof(uint64_t)); ++word_id) { |
| 340 | arrow::util::SafeStore<uint64_t>(dst + word_id, |
| 341 | arrow::util::SafeLoad(src + word_id)); |
| 342 | } |
| 343 | }); |
nothing calls this directly
no test coverage detected