pitrou commented on code in PR #12829:
URL: https://github.com/apache/arrow/pull/12829#discussion_r861098633
##########
cpp/src/parquet/arrow/reader_internal.cc:
##########
@@ -640,43 +696,55 @@ static Status DecimalIntegerTransfer(RecordReader*
reader, MemoryPool* pool,
/// representing the high and low bits of each decimal value.
template <typename DecimalArrayType, typename ParquetType>
Status TransferDecimal(RecordReader* reader, MemoryPool* pool,
- const std::shared_ptr<DataType>& type, Datum* out) {
+ const std::shared_ptr<Field>& field, Datum* out) {
auto binary_reader = dynamic_cast<BinaryRecordReader*>(reader);
DCHECK(binary_reader);
::arrow::ArrayVector chunks = binary_reader->GetBuilderChunks();
for (size_t i = 0; i < chunks.size(); ++i) {
std::shared_ptr<Array> chunk_as_decimal;
auto fn = &DecimalConverter<DecimalArrayType,
ParquetType>::ConvertToDecimal;
- RETURN_NOT_OK(fn(*chunks[i], type, pool, &chunk_as_decimal));
+ RETURN_NOT_OK(fn(*chunks[i], field->type(), pool, &chunk_as_decimal));
// Replace the chunk, which will hopefully also free memory as we go
chunks[i] = chunk_as_decimal;
}
- *out = std::make_shared<ChunkedArray>(chunks, type);
+ if (!field->nullable()) {
Review Comment:
Looks like you forgot to refactor this one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]