pub struct StaticTable(/* private fields */);Expand description
StaticTable is a read-only table struct that can be created from a metadata file or from TableMetaData without a catalog.
It can only be used to read metadata and for table scan.
§Examples
let metadata_file_location = "s3://bucket_name/path/to/metadata.json";
let file_io = FileIO::from_path(&metadata_file_location)
.unwrap()
.build()
.unwrap();
let static_identifier = TableIdent::from_strs(["static_ns", "static_table"]).unwrap();
let static_table =
StaticTable::from_metadata_file(&metadata_file_location, static_identifier, file_io)
.await
.unwrap();
let snapshot_id = static_table
.metadata()
.current_snapshot()
.unwrap()
.snapshot_id();Implementations§
Source§impl StaticTable
impl StaticTable
Sourcepub async fn from_metadata(
metadata: TableMetadata,
table_ident: TableIdent,
file_io: FileIO,
) -> Result<Self>
pub async fn from_metadata( metadata: TableMetadata, table_ident: TableIdent, file_io: FileIO, ) -> Result<Self>
Creates a static table from a given TableMetadata and FileIO
Sourcepub async fn from_metadata_file(
metadata_location: &str,
table_ident: TableIdent,
file_io: FileIO,
) -> Result<Self>
pub async fn from_metadata_file( metadata_location: &str, table_ident: TableIdent, file_io: FileIO, ) -> Result<Self>
Creates a static table directly from metadata file and FileIO
Sourcepub fn scan(&self) -> TableScanBuilder<'_>
pub fn scan(&self) -> TableScanBuilder<'_>
Create a TableScanBuilder for the static table.
Sourcepub fn metadata(&self) -> TableMetadataRef
pub fn metadata(&self) -> TableMetadataRef
Get TableMetadataRef for the static table
Sourcepub fn into_table(self) -> Table
pub fn into_table(self) -> Table
Consumes the StaticTable and return it as a Table
Please use this method carefully as the Table it returns remains detached from a catalog
and can’t be used to perform modifications on the table.
Sourcepub fn reader_builder(&self) -> ArrowReaderBuilder
pub fn reader_builder(&self) -> ArrowReaderBuilder
Create a reader for the table.
Trait Implementations§
Source§impl Clone for StaticTable
impl Clone for StaticTable
Source§fn clone(&self) -> StaticTable
fn clone(&self) -> StaticTable
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StaticTable
impl !RefUnwindSafe for StaticTable
impl Send for StaticTable
impl Sync for StaticTable
impl Unpin for StaticTable
impl !UnwindSafe for StaticTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any.§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