huan233usc commented on code in PR #800:
URL: https://github.com/apache/iceberg-cpp/pull/800#discussion_r3631817298


##########
src/iceberg/avro/avro_data_util.cc:
##########
@@ -497,6 +506,29 @@ Status AppendFieldToBuilder(const ::avro::NodePtr& 
avro_node,
 
 }  // namespace
 
+Status AppendDefaultToBuilder(const Literal& literal, ::arrow::ArrayBuilder* 
builder) {
+  // The builder's own memory pool is not exposed, so the small scalar buffer 
uses the
+  // default pool.
+  ICEBERG_ASSIGN_OR_RAISE(std::shared_ptr<::arrow::Scalar> scalar,
+                          arrow::ToArrowScalar(literal, 
::arrow::default_memory_pool()));
+

Review Comment:
   Fixed in 0e4c6a40: added `PrepareDefaultScalars` to cache a cast Arrow 
scalar in `FieldProjection::attributes` (`AvroDefaultAttributes`) when the Avro 
reader initializes; per-row default fills now only call `AppendScalar`.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to