diff --git a/arrow-array/src/record_batch.rs b/arrow-array/src/record_batch.rs index 86222233bbb7..bfd5dafbe3b6 100644 --- a/arrow-array/src/record_batch.rs +++ b/arrow-array/src/record_batch.rs @@ -665,21 +665,6 @@ impl RecordBatch { .sum() } - /// THIS METHOD IS ARAS ONLY - /// - /// Converts the fields of the batch to nullable. - pub fn make_fields_nullable(&mut self) { - let fields = self - .schema() - .fields() - .iter() - .map(|field| field.as_ref().clone().with_nullable(true)).collect::>(); - self.schema = Arc::new(Schema::new_with_metadata( - fields, - self.schema().metadata().clone(), - )); - } - /// THIS METHOD IS ARAS ONLY /// /// Gets the metadata_flags of RecordBatch diff --git a/arrow-schema/src/schema.rs b/arrow-schema/src/schema.rs index cc3a8a308a83..c80e041db219 100644 --- a/arrow-schema/src/schema.rs +++ b/arrow-schema/src/schema.rs @@ -461,6 +461,17 @@ impl Schema { pub fn remove(&mut self, index: usize) -> FieldRef { self.fields.remove(index) } + + /// THIS METHOD IS ARAS ONLY + /// + /// Converts the fields of the batch to nullable. + pub fn make_fields_nullable(&mut self) { + let fields = self + .fields + .iter() + .map(|field| field.as_ref().clone().with_nullable(true)); + self.fields = Fields::from_iter(fields); + } } impl fmt::Display for Schema {