Skip to content

Commit

Permalink
Add Loggable::arrow_empty with default impl
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jan 9, 2025
1 parent 09a97ca commit abce9f5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/store/re_types_core/src/loggable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ pub trait Loggable: 'static + Send + Sync + Clone + Sized + SizeBytes {
/// The underlying [`arrow::datatypes::DataType`], excluding datatype extensions.
fn arrow_datatype() -> arrow::datatypes::DataType;

// Returns an empty Arrow array that matches this `Loggable`'s underlying datatype.
#[inline]
fn arrow_empty() -> arrow::array::ArrayRef {
arrow::array::new_empty_array(&Self::arrow_datatype())
}

/// Given an iterator of owned or reference values to the current [`Loggable`], serializes
/// them into an Arrow array.
///
Expand Down

0 comments on commit abce9f5

Please sign in to comment.