pub struct FileReader { /* private fields */ }Expand description
A current-format Lance file reader backed by fully decoded metadata.
Implementations§
Source§impl FileReader
impl FileReader
pub fn with_scheduler(&self, scheduler: Arc<dyn EncodingsIo>) -> Self
Sourcepub fn with_io_stats(&self, stats: Arc<dyn IoStatsRecorder>) -> Self
pub fn with_io_stats(&self, stats: Arc<dyn IoStatsRecorder>) -> Self
Returns a clone of this reader whose I/O is additionally recorded into
stats, on top of the scheduler’s global accounting.
All cached metadata is shared with self, so no file is re-opened and
only a few Arc clones are performed. If the underlying I/O service
does not support per-scope statistics (e.g. an in-memory scheduler), the
returned reader is an ordinary, uninstrumented clone.
pub fn num_rows(&self) -> u64
Sourcepub fn column_num_rows(&self, column_index: usize) -> Result<u64>
pub fn column_num_rows(&self, column_index: usize) -> Result<u64>
The number of rows stored in a single physical column.
For ordinary (rectangular) files every column has the same length, equal
to num_rows. Files written with
FileWriter::write_column
may have columns of differing lengths; this returns the length of one
such column, derived by summing its pages’ row counts. Errors if
column_index is out of bounds.
pub fn metadata(&self) -> &Arc<CachedFileMetadata> ⓘ
pub fn file_statistics(&self) -> FileStatistics
pub async fn read_global_buffer(&self, index: u32) -> Result<Bytes>
pub fn schema(&self) -> &Arc<Schema> ⓘ
Source§impl FileReader
impl FileReader
pub async fn try_open( scheduler: FileScheduler, base_projection: Option<ReaderProjection>, decoder_plugins: Arc<DecoderPlugins>, cache: &LanceCache, options: FileReaderOptions, ) -> Result<Self>
pub async fn try_open_with_file_metadata( scheduler: Arc<dyn EncodingsIo>, path: Path, base_projection: Option<ReaderProjection>, decoder_plugins: Arc<DecoderPlugins>, metadata: Arc<CachedFileMetadata>, cache: &LanceCache, options: FileReaderOptions, ) -> Result<Self>
pub async fn read_all_metadata( scheduler: &FileScheduler, ) -> Result<CachedFileMetadata>
pub async fn read_metadata_index( scheduler: &FileScheduler, ) -> Result<FileMetadataIndex>
pub async fn read_metadata_index_with_schema( scheduler: &FileScheduler, file_schema: Arc<Schema>, num_rows: u64, ) -> Result<FileMetadataIndex>
pub fn version(&self) -> ConcreteFileVersion
pub async fn read_tasks( &self, params: ReadBatchParams, batch_size: u32, projection: Option<ReaderProjection>, filter: FilterExpression, ) -> Result<Pin<Box<dyn Stream<Item = ReadBatchTask> + Send>>>
pub async fn read_stream_projected( &self, params: ReadBatchParams, batch_size: u32, batch_readahead: u32, projection: ReaderProjection, filter: FilterExpression, ) -> Result<Pin<Box<dyn RecordBatchStream>>>
pub fn read_stream_projected_blocking( &self, params: ReadBatchParams, batch_size: u32, projection: Option<ReaderProjection>, filter: FilterExpression, ) -> Result<Box<dyn RecordBatchReader + Send + 'static>>
pub async fn read_stream( &self, params: ReadBatchParams, batch_size: u32, batch_readahead: u32, filter: FilterExpression, ) -> Result<Pin<Box<dyn RecordBatchStream>>>
Trait Implementations§
Source§impl Clone for FileReader
impl Clone for FileReader
Source§fn clone(&self) -> FileReader
fn clone(&self) -> FileReader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FileReader
impl !UnwindSafe for FileReader
impl Freeze for FileReader
impl Send for FileReader
impl Sync for FileReader
impl Unpin for FileReader
impl UnsafeUnpin for FileReader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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> ⓘ
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> ⓘ
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