[go: up one dir, main page]

DeltaTable

Struct DeltaTable 

Source
pub struct DeltaTable {
    pub state: Option<DeltaTableState>,
    pub config: DeltaTableConfig,
    /* private fields */
}
Expand description

In memory representation of a Delta Table

A DeltaTable is a purely logical concept that represents a dataset that can ewvolve over time. To attain concrete information about a table a snapshot need to be loaded. Most commonly this is the latest state of the tablem but may also loaded for a specific version or point in time.

Fields§

§state: Option<DeltaTableState>

The state of the table as of the most recent loaded Delta log entry.

§config: DeltaTableConfig

the load options used during load

Implementations§

Source§

impl DeltaTable

Source

pub fn new(log_store: Arc<dyn LogStore>, config: DeltaTableConfig) -> DeltaTable

Create a new Delta Table struct without loading any data from backing storage.

NOTE: This is for advanced users. If you don’t know why you need to use this method, please call one of the open_table helper methods instead.

Source

pub fn object_store(&self) -> Arc<dyn ObjectStore>

get a shared reference to the delta object store

Source

pub async fn verify_deltatable_existence(&self) -> Result<bool, DeltaTableError>

Check if the DeltaTable exists

Source

pub fn table_uri(&self) -> String

The URI of the underlying data

Source

pub fn log_store(&self) -> Arc<dyn LogStore>

get a shared reference to the log store

Source

pub async fn get_latest_version(&self) -> Result<i64, DeltaTableError>

returns the latest available version of the table

Source

pub fn version(&self) -> Option<i64>

Currently loaded version of the table - if any.

This will return the latest version of the table if it has been loaded. Returns None if the table has not been loaded.

Source

pub async fn load(&mut self) -> Result<(), DeltaTableError>

Load DeltaTable with data from latest checkpoint

Source

pub async fn update(&mut self) -> Result<(), DeltaTableError>

Updates the DeltaTable to the most recent state committed to the transaction log by loading the last checkpoint and incrementally applying each version since.

Source

pub async fn update_incremental( &mut self, max_version: Option<i64>, ) -> Result<(), DeltaTableError>

Updates the DeltaTable to the latest version by incrementally applying newer versions. It assumes that the table is already updated to the current version self.version.

Source

pub async fn load_version( &mut self, version: i64, ) -> Result<(), DeltaTableError>

Loads the DeltaTable state for the given version.

Source

pub async fn history( &self, limit: Option<usize>, ) -> Result<impl Iterator<Item = CommitInfo>, DeltaTableError>

Returns provenance information, including the operation, user, and so on, for each write to a table. The table history retention is based on the logRetentionDuration property of the Delta Table, 30 days by default. If limit is given, this returns the information of the latest limit commits made to this table. Otherwise, it returns all commits from the earliest commit.

Source

pub fn get_active_add_actions_by_partitions( &self, filters: &[PartitionFilter], ) -> Pin<Box<dyn Stream<Item = Result<LogicalFileView, DeltaTableError>> + Send + '_>>

Stream all logical files matching the provided PartitionFilters.

Source

pub async fn get_files_by_partitions( &self, filters: &[PartitionFilter], ) -> Result<Vec<Path>, DeltaTableError>

Returns the file list tracked in current table state filtered by provided PartitionFilters.

Source

pub async fn get_file_uris_by_partitions( &self, filters: &[PartitionFilter], ) -> Result<Vec<String>, DeltaTableError>

Return the file uris as strings for the partition(s)

Source

pub fn get_file_uris( &self, ) -> Result<impl Iterator<Item = String>, DeltaTableError>

Returns a URIs for all active files present in the current table version.

Source

pub fn snapshot(&self) -> Result<&DeltaTableState, DeltaTableError>

Returns the currently loaded state snapshot.

This method provides access to the currently loaded state of the Delta table.

§Returns

A reference to the current state of the Delta table.

§Errors

Returns NotInitialized if the table has not been initialized.

Source

pub async fn load_with_datetime( &mut self, datetime: DateTime<Utc>, ) -> Result<(), DeltaTableError>

Time travel Delta table to the latest version that’s created at or before provided datetime argument.

Internally, this methods performs a binary search on all Delta transaction logs.

Trait Implementations§

Source§

impl AsRef<DeltaTable> for DeltaOps

Source§

fn as_ref(&self) -> &DeltaTable

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for DeltaTable

Source§

fn clone(&self) -> DeltaTable

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeltaTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DeltaTable

Source§

fn deserialize<D>( deserializer: D, ) -> Result<DeltaTable, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for DeltaTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl From<DeltaOps> for DeltaTable

Source§

fn from(ops: DeltaOps) -> DeltaTable

Converts to this type from the input type.
Source§

impl From<DeltaTable> for DeltaOps

Source§

fn from(table: DeltaTable) -> DeltaOps

Converts to this type from the input type.
Source§

impl Serialize for DeltaTable

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TableProvider for DeltaTable

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the table provider as Any so that it can be downcast to a specific implementation.
Source§

fn schema(&self) -> Arc<Schema>

Get a reference to the schema for this table
Source§

fn table_type(&self) -> TableType

Get the type of this table for metadata/catalog purposes.
Source§

fn get_table_definition(&self) -> Option<&str>

Get the create statement used to create this table, if available.
Source§

fn get_logical_plan(&self) -> Option<Cow<'_, LogicalPlan>>

Get the LogicalPlan of this table, if available.
Source§

fn scan<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, session: &'life1 dyn Session, projection: Option<&'life2 Vec<usize>>, filters: &'life3 [Expr], limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>, DataFusionError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, DeltaTable: 'async_trait,

Create an ExecutionPlan for scanning the table with optionally specified projection, filter and limit, described below. Read more
Source§

fn supports_filters_pushdown( &self, filter: &[&Expr], ) -> Result<Vec<TableProviderFilterPushDown>, DataFusionError>

Specify if DataFusion should provide filter expressions to the TableProvider to apply during the scan. Read more
Source§

fn statistics(&self) -> Option<Statistics>

Get statistics for this table, if available Although not presently used in mainline DataFusion, this allows implementation specific behavior for downstream repositories, in conjunction with specialized optimizer rules to perform operations such as re-ordering of joins.
Source§

fn constraints(&self) -> Option<&Constraints>

Get a reference to the constraints of the table. Returns: Read more
Source§

fn get_column_default(&self, _column: &str) -> Option<&Expr>

Get the default value for a column, if available.
Source§

fn insert_into<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 dyn Session, _input: Arc<dyn ExecutionPlan>, _insert_op: InsertOp, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>, DataFusionError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Return an ExecutionPlan to insert data into this table, if supported. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any + Send + Sync,

Source§

fn any_ref(&self) -> &(dyn Any + Sync + Send + 'static)

Obtains a dyn Any reference to the object: Read more
Source§

fn as_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Obtains an Arc<dyn Any> reference to the object: Read more
Source§

fn into_any(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts the object to Box<dyn Any>: Read more
Source§

fn type_name(&self) -> &'static str

Convenient wrapper for std::any::type_name, since Any does not provide it and Any::type_id is useless as a debugging aid (its Debug is just a mess of hex digits).
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<KernelType, ArrowType> TryIntoArrow<ArrowType> for KernelType
where ArrowType: TryFromKernel<KernelType>,

Source§

fn try_into_arrow(self) -> Result<ArrowType, ArrowError>

Source§

impl<KernelType, ArrowType> TryIntoKernel<KernelType> for ArrowType
where KernelType: TryFromArrow<ArrowType>,

Source§

fn try_into_kernel(self) -> Result<KernelType, ArrowError>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ValidateIp for T
where T: ToString,

Source§

fn validate_ipv4(&self) -> bool

Validates whether the given string is an IP V4
Source§

fn validate_ipv6(&self) -> bool

Validates whether the given string is an IP V6
Source§

fn validate_ip(&self) -> bool

Validates whether the given string is an IP
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Ungil for T
where T: Send,