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

Function TransferDecimal

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

Source from the content-addressed store, hash-verified

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