Skip to content

Commit

Permalink
Merge pull request #13 from synnada-ai/record-batch-flags
Browse files Browse the repository at this point in the history
Add an API for Converting Fields to Nullable
  • Loading branch information
berkaysynnada authored Nov 27, 2024
2 parents eec18ae + c7e19a0 commit 5823472
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arrow-array/src/record_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,21 @@ 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::<Vec<_>>();
self.schema = Arc::new(Schema::new_with_metadata(
fields,
self.schema().metadata().clone(),
));
}

/// THIS METHOD IS ARAS ONLY
///
/// Gets the metadata_flags of RecordBatch
Expand Down

0 comments on commit 5823472

Please sign in to comment.