lesterfan commented on code in PR #45685: URL: https://github.com/apache/arrow/pull/45685#discussion_r1983027563
########## cpp/src/parquet/arrow/reader_internal.cc: ########## @@ -256,6 +256,23 @@ Status ByteArrayStatisticsAsScalars(const Statistics& statistics, return Status::OK(); } +Result<std::shared_ptr<ChunkedArray>> ViewOrCastChunkedArray( + const std::shared_ptr<ChunkedArray>& array, + const std::shared_ptr<DataType>& logical_value_type) { + auto view_result = array->View(logical_value_type); + if (view_result.ok()) { + return view_result.ValueOrDie(); + } else { + ::arrow::ArrayVector casted_chunks; + for (const auto& chunk : array->chunks()) { + ARROW_ASSIGN_OR_RAISE(auto cast_chunk, + ::arrow::compute::Cast(chunk, logical_value_type)); + casted_chunks.push_back(cast_chunk.make_array()); + } Review Comment: This makes sense; I didn't know about (1). Maybe a dumb question for (2), but how should I determine which `MemoryPool` to use? -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org