gbrgr commented on code in PR #1824:
URL: https://github.com/apache/iceberg-rust/pull/1824#discussion_r2580822250


##########
crates/iceberg/src/arrow/record_batch_transformer.rs:
##########
@@ -173,11 +186,34 @@ impl RecordBatchTransformerBuilder {
     ///
     /// # Arguments
     /// * `field_id` - The field ID to associate with the constant
-    /// * `value` - The constant value for this field
-    pub(crate) fn with_constant(mut self, field_id: i32, value: 
PrimitiveLiteral) -> Result<Self> {
-        let arrow_type = 
RecordBatchTransformer::primitive_literal_to_arrow_type(&value)?;
-        self.constant_fields.insert(field_id, (arrow_type, value));
-        Ok(self)
+    /// * `datum` - The constant value (with type) for this field
+    pub(crate) fn with_constant(mut self, field_id: i32, datum: Datum) -> Self 
{
+        self.constant_fields.insert(field_id, datum);
+        self
+    }
+
+    /// Add a reserved/metadata field with a constant string value.
+    /// This is a convenience method for reserved fields like _file that 
automatically
+    /// handles type extraction from the field definition.
+    ///
+    /// # Arguments
+    /// * `field_id` - The reserved field ID (e.g., RESERVED_FIELD_ID_FILE)
+    /// * `value` - The constant string value for this field
+    ///
+    /// # Returns
+    /// Self for method chaining, or an error if the field is not a valid 
metadata field
+    pub(crate) fn with_reserved_field(self, field_id: i32, value: String) -> 
Result<Self> {

Review Comment:
   Sorry that was a refactoring leftover, removed it since it is specialized on 
strings.



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