pitrou commented on code in PR #45688: URL: https://github.com/apache/arrow/pull/45688#discussion_r1989375257
########## cpp/src/parquet/column_writer.cc: ########## @@ -1364,6 +1367,41 @@ class TypedColumnWriterImpl : public ColumnWriterImpl, public TypedColumnWriter< int64_t num_levels, const ::arrow::Array& array, ArrowWriteContext* context, bool maybe_parent_nulls); + template <typename ArrowType> + Status WriteArrowSerialize(const int16_t* def_levels, const int16_t* rep_levels, + int64_t num_levels, const ::arrow::Array& array, + ArrowWriteContext* ctx, bool maybe_parent_nulls); + + Status WriteArrowZeroCopy(const int16_t* def_levels, const int16_t* rep_levels, + int64_t num_levels, const ::arrow::Array& array, + ArrowWriteContext* ctx, bool maybe_parent_nulls) { + const auto& data = static_cast<const ::arrow::PrimitiveArray&>(array); + const T* values = nullptr; + // The values buffer may be null if the array is empty (ARROW-2744) + if (data.values() != nullptr) { + values = reinterpret_cast<const T*>(data.values()->data()) + data.offset(); + } else { + DCHECK_EQ(data.length(), 0); + } Review Comment: Can probably change this to: ```suggestion const T* values = data.data()->GetValues<T>(1); ``` -- 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