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

Function TransferDate64

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

Source from the content-addressed store, hash-verified

543}
544
545Status 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

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