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