pub struct CsvOpener {
config: Arc<CsvSource>,
file_compression_type: FileCompressionType,
object_store: Arc<dyn ObjectStore>,
}Expand description
A FileOpener that opens a CSV file and yields a FileOpenFuture
Fields§
§config: Arc<CsvSource>§file_compression_type: FileCompressionType§object_store: Arc<dyn ObjectStore>Implementations§
Trait Implementations§
Source§impl FileOpener for CsvOpener
impl FileOpener for CsvOpener
Source§fn open(
&self,
partitioned_file: PartitionedFile,
) -> Result<Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<RecordBatch, DataFusionError>> + Send>>, DataFusionError>> + Send>>, DataFusionError>
fn open( &self, partitioned_file: PartitionedFile, ) -> Result<Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<RecordBatch, DataFusionError>> + Send>>, DataFusionError>> + Send>>, DataFusionError>
Open a partitioned CSV file.
If file_meta.range is None, the entire file is opened.
If file_meta.range is Some(FileRange {start, end}), this signifies that the partition
corresponds to the byte range [start, end) within the file.
Note: start or end might be in the middle of some lines. In such cases, the following rules
are applied to determine which lines to read:
- The first line of the partition is the line in which the index of the first character >=
start. - The last line of the partition is the line in which the byte at position
end - 1resides.
Examples:
Consider the following partitions enclosed by braces {}:
{A,1,2,3,4,5,6,7,8,9\n A,1,2,3,4,5,6,7,8,9\n} A,1,2,3,4,5,6,7,8,9\n The lines read would be: [0, 1]
A,{1,2,3,4,5,6,7,8,9\n A,1,2,3,4,5,6,7,8,9\n A},1,2,3,4,5,6,7,8,9\n The lines read would be: [1, 2]
Auto Trait Implementations§
impl Freeze for CsvOpener
impl !RefUnwindSafe for CsvOpener
impl Send for CsvOpener
impl Sync for CsvOpener
impl Unpin for CsvOpener
impl !UnwindSafe for CsvOpener
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