| 543 | } |
| 544 | |
| 545 | Status TransferDate64(RecordReader* reader, MemoryPool* pool, |
| 546 | const std::shared_ptr<Field>& field, Datum* out) { |
| 547 | int64_t length = reader->values_written(); |
| 548 | auto values = reinterpret_cast<const int32_t*>(reader->values()); |
| 549 | |
| 550 | ARROW_ASSIGN_OR_RAISE(auto data, |
| 551 | ::arrow::AllocateBuffer(length * sizeof(int64_t), pool)); |
| 552 | auto out_ptr = reinterpret_cast<int64_t*>(data->mutable_data()); |
| 553 | |
| 554 | for (int64_t i = 0; i < length; i++) { |
| 555 | *out_ptr++ = static_cast<int64_t>(values[i]) * kMillisecondsPerDay; |
| 556 | } |
| 557 | |
| 558 | if (field->nullable()) { |
| 559 | *out = std::make_shared<::arrow::Date64Array>(field->type(), length, std::move(data), |
| 560 | reader->ReleaseIsValid(), |
| 561 | reader->null_count()); |
| 562 | } else { |
| 563 | *out = |
| 564 | std::make_shared<::arrow::Date64Array>(field->type(), length, std::move(data), |
| 565 | /*null_bitmap=*/nullptr, /*null_count=*/0); |
| 566 | } |
| 567 | return Status::OK(); |
| 568 | } |
| 569 | |
| 570 | // ---------------------------------------------------------------------- |
| 571 | // Binary, direct to dictionary-encoded |
no test coverage detected