| 799 | /// representing the high and low bits of each decimal value. |
| 800 | template <typename DecimalArrayType, typename ParquetType> |
| 801 | Status 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 | |
| 820 | template <typename DecimalArrayType, typename... Args> |
| 821 | Status TransferDecimalTo(Type::type physical_type, Args&&... args) { |
nothing calls this directly
no test coverage detected