pub struct EventTimeExtractor { /* private fields */ }Expand description
Extracts event timestamps from Arrow RecordBatch columns.
Supports multiple timestamp formats and extraction modes for multi-row batches. Uses internal caching for column index lookup to optimize repeated extractions.
Implementations§
Source§impl EventTimeExtractor
impl EventTimeExtractor
Sourcepub fn from_column(name: &str, format: TimestampFormat) -> Self
pub fn from_column(name: &str, format: TimestampFormat) -> Self
Creates an extractor that looks up a column by name.
The column index is cached after the first extraction for efficiency.
Sourcepub fn from_index(index: usize, format: TimestampFormat) -> Self
pub fn from_index(index: usize, format: TimestampFormat) -> Self
Creates an extractor that uses a column by index.
This is the most efficient option as no lookup is required.
Sourcepub fn with_mode(self, mode: ExtractionMode) -> Self
pub fn with_mode(self, mode: ExtractionMode) -> Self
Sets the extraction mode for multi-row batches.
Sourcepub fn format(&self) -> TimestampFormat
pub fn format(&self) -> TimestampFormat
Gets the configured format.
Sourcepub fn mode(&self) -> ExtractionMode
pub fn mode(&self) -> ExtractionMode
Gets the configured mode.
Sourcepub fn validate_schema(&self, schema: &Schema) -> Result<(), EventTimeError>
pub fn validate_schema(&self, schema: &Schema) -> Result<(), EventTimeError>
Validates that the schema contains a compatible timestamp column.
§Errors
Returns an error if the column is not found or has an incompatible type.
Sourcepub fn extract(&mut self, batch: &RecordBatch) -> Result<i64, EventTimeError>
pub fn extract(&mut self, batch: &RecordBatch) -> Result<i64, EventTimeError>
Extracts the event timestamp from a batch.
Returns the timestamp in milliseconds since Unix epoch.
§Errors
Returns an error if:
- The batch is empty
- The column is not found
- The column type is incompatible with the format
- The timestamp value is null
- The timestamp cannot be parsed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventTimeExtractor
impl RefUnwindSafe for EventTimeExtractor
impl Send for EventTimeExtractor
impl Sync for EventTimeExtractor
impl Unpin for EventTimeExtractor
impl UnwindSafe for EventTimeExtractor
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.