MCPcopy Create free account
hub / github.com/apache/arrow / TransferDate64

Function TransferDate64

cpp/src/parquet/arrow/reader_internal.cc:546–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

TransferColumnDataFunction · 0.85

Calls 7

nullableMethod · 0.80
ReleaseIsValidMethod · 0.80
OKFunction · 0.50
valuesMethod · 0.45
mutable_dataMethod · 0.45
typeMethod · 0.45
null_countMethod · 0.45

Tested by

no test coverage detected