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

Function TransferDecimal

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

Source from the content-addressed store, hash-verified

798/// representing the high and low bits of each decimal value.
799template <typename DecimalArrayType, typename ParquetType>
800Status TransferDecimal(RecordReader* reader, MemoryPool* pool,
801 const std::shared_ptr<Field>& field, Datum* out) {
802 auto binary_reader = dynamic_cast<BinaryRecordReader*>(reader);
803 DCHECK(binary_reader);
804 ::arrow::ArrayVector chunks = binary_reader->GetBuilderChunks();
805 for (size_t i = 0; i < chunks.size(); ++i) {
806 std::shared_ptr<Array> chunk_as_decimal;
807 auto fn = &DecimalConverter<DecimalArrayType, ParquetType>::ConvertToDecimal;
808 RETURN_NOT_OK(fn(*chunks[i], field->type(), pool, &chunk_as_decimal));
809 // Replace the chunk, which will hopefully also free memory as we go
810 chunks[i] = chunk_as_decimal;
811 }
812 if (!field->nullable()) {
813 ReconstructChunksWithoutNulls(&chunks);
814 }
815 *out = std::make_shared<ChunkedArray>(chunks, field->type());
816 return Status::OK();
817}
818
819template <typename DecimalArrayType, typename... Args>
820Status TransferDecimalTo(Type::type physical_type, Args&&... args) {

Callers

nothing calls this directly

Calls 6

nullableMethod · 0.80
OKFunction · 0.50
GetBuilderChunksMethod · 0.45
sizeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected