pub struct FileStreamProvider {
location: PathBuf,
encoding: StreamEncoding,
pub schema: Arc<Schema>,
header: bool,
batch_size: usize,
}Expand description
Stream data from the file at location
- Data will be read sequentially from the provided
location - New data will be appended to the end of the file
The encoding can be configured with Self::with_encoding and
defaults to StreamEncoding::Csv
Fields§
§location: PathBuf§encoding: StreamEncoding§schema: Arc<Schema>Get a reference to the schema for this file stream
header: bool§batch_size: usizeImplementations§
Source§impl FileStreamProvider
impl FileStreamProvider
Sourcepub fn new_file(schema: Arc<Schema>, location: PathBuf) -> FileStreamProvider
pub fn new_file(schema: Arc<Schema>, location: PathBuf) -> FileStreamProvider
Stream data from the file at location
- Data will be read sequentially from the provided
location - New data will be appended to the end of the file
The encoding can be configured with Self::with_encoding and
defaults to StreamEncoding::Csv
Sourcepub fn with_batch_size(self, batch_size: usize) -> FileStreamProvider
pub fn with_batch_size(self, batch_size: usize) -> FileStreamProvider
Set the batch size (the number of rows to load at one time)
Sourcepub fn with_header(self, header: bool) -> FileStreamProvider
pub fn with_header(self, header: bool) -> FileStreamProvider
Specify whether the file has a header (only applicable for StreamEncoding::Csv)
Sourcepub fn with_encoding(self, encoding: StreamEncoding) -> FileStreamProvider
pub fn with_encoding(self, encoding: StreamEncoding) -> FileStreamProvider
Specify an encoding for the stream
Trait Implementations§
Source§impl Debug for FileStreamProvider
impl Debug for FileStreamProvider
Source§impl StreamProvider for FileStreamProvider
impl StreamProvider for FileStreamProvider
Source§fn reader(
&self,
) -> Result<Box<dyn RecordBatchReader<Item = Result<RecordBatch, ArrowError>>>, DataFusionError>
fn reader( &self, ) -> Result<Box<dyn RecordBatchReader<Item = Result<RecordBatch, ArrowError>>>, DataFusionError>
Provide
RecordBatchReaderSource§fn writer(&self) -> Result<Box<dyn RecordBatchWriter>, DataFusionError>
fn writer(&self) -> Result<Box<dyn RecordBatchWriter>, DataFusionError>
Provide
RecordBatchWriterSource§fn stream_write_display(
&self,
_t: DisplayFormatType,
f: &mut Formatter<'_>,
) -> Result<(), Error>
fn stream_write_display( &self, _t: DisplayFormatType, f: &mut Formatter<'_>, ) -> Result<(), Error>
Display implementation when using as a DataSink
Auto Trait Implementations§
impl Freeze for FileStreamProvider
impl RefUnwindSafe for FileStreamProvider
impl Send for FileStreamProvider
impl Sync for FileStreamProvider
impl Unpin for FileStreamProvider
impl UnwindSafe for FileStreamProvider
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more