pub struct ProjectedFileReader { /* private fields */ }Expand description
A projection-scoped reader for Lance files.
This reader fixes a base projection at construction time. All later reads
must stay within that projection, which lets the reader load only the column
metadata needed by the base projection when opening from a FileMetadataIndex.
It intentionally does not expose APIs that require synchronous access to full
file metadata.
Implementations§
Source§impl ProjectedFileReader
impl ProjectedFileReader
Sourcepub 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( scheduler: FileScheduler, base_projection: Option<ReaderProjection>, decoder_plugins: Arc<DecoderPlugins>, cache: &LanceCache, options: FileReaderOptions, ) -> Result<Self>
Opens a data reader backed by indexed column metadata.
base_projection must be a supported indexed projection. Reads that do
not pass an explicit projection use this base projection.
Sourcepub async fn try_open_with_metadata_index(
scheduler: Arc<dyn EncodingsIo>,
path: Path,
base_projection: Option<ReaderProjection>,
decoder_plugins: Arc<DecoderPlugins>,
metadata_index: Arc<FileMetadataIndex>,
cache: &LanceCache,
options: FileReaderOptions,
) -> Result<Self>
pub async fn try_open_with_metadata_index( scheduler: Arc<dyn EncodingsIo>, path: Path, base_projection: Option<ReaderProjection>, decoder_plugins: Arc<DecoderPlugins>, metadata_index: Arc<FileMetadataIndex>, cache: &LanceCache, options: FileReaderOptions, ) -> Result<Self>
Opens a data reader from a previously loaded metadata index.
base_projection must be a supported indexed projection. Use
Self::try_open_with_file_metadata when the default read should cover
the whole file schema.
pub async fn try_open_with_file_metadata( scheduler: Arc<dyn EncodingsIo>, path: Path, base_projection: Option<ReaderProjection>, decoder_plugins: Arc<DecoderPlugins>, file_metadata: Arc<CachedFileMetadata>, cache: &LanceCache, options: FileReaderOptions, ) -> Result<Self>
Sourcepub fn supports_projection(
projection: &ReaderProjection,
version: LanceFileVersion,
) -> bool
pub fn supports_projection( projection: &ReaderProjection, version: LanceFileVersion, ) -> bool
Returns whether a projection can be served by indexed column metadata.
Sourcepub fn with_scheduler(&self, scheduler: Arc<dyn EncodingsIo>) -> Self
pub fn with_scheduler(&self, scheduler: Arc<dyn EncodingsIo>) -> Self
Returns a clone of this reader using a different scheduler.
Sourcepub fn version(&self) -> LanceFileVersion
pub fn version(&self) -> LanceFileVersion
Returns the Lance file version.
Sourcepub fn file_statistics(&self) -> Option<FileStatistics>
pub fn file_statistics(&self) -> Option<FileStatistics>
Returns file statistics when this reader has full file metadata.
Sourcepub async fn read_global_buffer(&self, index: u32) -> Result<Bytes>
pub async fn read_global_buffer(&self, index: u32) -> Result<Bytes>
Reads a global buffer by index.
Sourcepub 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_tasks( &self, params: ReadBatchParams, batch_size: u32, projection: Option<ReaderProjection>, filter: FilterExpression, ) -> Result<Pin<Box<dyn Stream<Item = ReadBatchTask> + Send>>>
Creates a stream of read tasks for the requested rows and projection.
Trait Implementations§
Source§impl Clone for ProjectedFileReader
impl Clone for ProjectedFileReader
Source§fn clone(&self) -> ProjectedFileReader
fn clone(&self) -> ProjectedFileReader
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 ProjectedFileReader
impl !UnwindSafe for ProjectedFileReader
impl Freeze for ProjectedFileReader
impl Send for ProjectedFileReader
impl Sync for ProjectedFileReader
impl Unpin for ProjectedFileReader
impl UnsafeUnpin for ProjectedFileReader
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