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


##########
src/iceberg/avro/avro_data_util_internal.h:
##########
@@ -19,14 +19,48 @@
 
 #pragma once
 
+#include <memory>
+
 #include <arrow/array/builder_base.h>
+#include <arrow/scalar.h>
 #include <avro/GenericDatum.hh>
 
 #include "iceberg/arrow/metadata_column_util_internal.h"
+#include "iceberg/expression/literal.h"
 #include "iceberg/schema_util.h"
 
 namespace iceberg::avro {
 
+/// \brief Cached Arrow scalar for a `kDefault` field projection.
+///
+/// Materialized once (see `PrepareDefaultScalars`) so row-by-row Avro decode 
only
+/// needs `AppendScalar` instead of repeating `ToArrowScalar` / `CastTo` per 
row.
+struct AvroDefaultAttributes : FieldProjection::ExtraAttributes {

Review Comment:
   Could this follow the `ParquetExtraAttributes` pattern and become 
`AvroExtraAttributes` with a `default_scalar` member? `FieldProjection` has a 
single attributes slot, so separate subclasses for future Avro attributes would 
not compose. A single Avro-specific container would also let the append path 
use `checked_cast` instead of a per-row `dynamic_cast`.



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