pub struct DeltaTableState { /* private fields */ }
Expand description
State snapshot currently held by the Delta Table instance.
Implementations§
Source§impl DeltaTableState
impl DeltaTableState
Sourcepub async fn try_new(
table_root: &Path,
store: Arc<dyn ObjectStore>,
config: DeltaTableConfig,
version: Option<i64>,
) -> DeltaResult<Self>
pub async fn try_new( table_root: &Path, store: Arc<dyn ObjectStore>, config: DeltaTableConfig, version: Option<i64>, ) -> DeltaResult<Self>
Create a new DeltaTableState
Sourcepub fn version_timestamp(&self, version: i64) -> Option<i64>
pub fn version_timestamp(&self, version: i64) -> Option<i64>
Get the timestamp when a version commit was created. This is the timestamp of the commit file. If the commit file is not present, None is returned.
Sourcepub fn log_data(&self) -> LogDataHandler<'_>
pub fn log_data(&self) -> LogDataHandler<'_>
Returns a semantic accessor to the currently loaded log data.
Sourcepub async fn all_tombstones(
&self,
store: Arc<dyn ObjectStore>,
) -> DeltaResult<impl Iterator<Item = Remove>>
pub async fn all_tombstones( &self, store: Arc<dyn ObjectStore>, ) -> DeltaResult<impl Iterator<Item = Remove>>
Full list of tombstones (remove actions) representing files removed from table state).
Sourcepub async fn unexpired_tombstones(
&self,
store: Arc<dyn ObjectStore>,
) -> DeltaResult<impl Iterator<Item = Remove>>
pub async fn unexpired_tombstones( &self, store: Arc<dyn ObjectStore>, ) -> DeltaResult<impl Iterator<Item = Remove>>
List of unexpired tombstones (remove actions) representing files removed from table state.
The retention period is set by deletedFileRetentionDuration
with default value of 1 week.
Sourcepub fn file_actions(&self) -> DeltaResult<Vec<Add>>
pub fn file_actions(&self) -> DeltaResult<Vec<Add>>
Full list of add actions representing all parquet files that are part of the current delta table state.
Sourcepub fn file_actions_iter(&self) -> DeltaResult<impl Iterator<Item = Add> + '_>
pub fn file_actions_iter(&self) -> DeltaResult<impl Iterator<Item = Add> + '_>
Full list of add actions representing all parquet files that are part of the current delta table state.
Sourcepub fn files_count(&self) -> usize
pub fn files_count(&self) -> usize
Get the number of files in the current table state
Sourcepub fn cdc_files(&self) -> DeltaResult<impl Iterator<Item = AddCDCFile> + '_>
pub fn cdc_files(&self) -> DeltaResult<impl Iterator<Item = AddCDCFile> + '_>
Full list of all of the CDC files added as part of the changeDataFeed feature
Sourcepub fn file_paths_iter(&self) -> impl Iterator<Item = Path> + '_
pub fn file_paths_iter(&self) -> impl Iterator<Item = Path> + '_
Returns an iterator of file names present in the loaded state
Sourcepub fn app_transaction_version(
&self,
) -> DeltaResult<impl Iterator<Item = Transaction> + '_>
pub fn app_transaction_version( &self, ) -> DeltaResult<impl Iterator<Item = Transaction> + '_>
HashMap containing the last transaction stored for every application.
Sourcepub fn schema(&self) -> &StructType
pub fn schema(&self) -> &StructType
The table schema
Sourcepub fn load_config(&self) -> &DeltaTableConfig
pub fn load_config(&self) -> &DeltaTableConfig
Get the table config which is loaded with of the snapshot
Sourcepub fn table_config(&self) -> TableConfig<'_>
pub fn table_config(&self) -> TableConfig<'_>
Well known table configuration
Sourcepub fn snapshot(&self) -> &EagerSnapshot
pub fn snapshot(&self) -> &EagerSnapshot
Obtain the Eager snapshot of the state
Sourcepub async fn update(
&mut self,
log_store: Arc<dyn LogStore>,
version: Option<i64>,
) -> Result<(), DeltaTableError>
pub async fn update( &mut self, log_store: Arc<dyn LogStore>, version: Option<i64>, ) -> Result<(), DeltaTableError>
Update the state of the table to the given version.
Sourcepub fn get_active_add_actions_by_partitions<'a>(
&'a self,
filters: &'a [PartitionFilter],
) -> Result<impl Iterator<Item = DeltaResult<LogicalFile<'a>>>, DeltaTableError>
pub fn get_active_add_actions_by_partitions<'a>( &'a self, filters: &'a [PartitionFilter], ) -> Result<impl Iterator<Item = DeltaResult<LogicalFile<'a>>>, DeltaTableError>
Obtain Add actions for files that match the filter
Source§impl DeltaTableState
impl DeltaTableState
Sourcepub fn add_actions_table(
&self,
flatten: bool,
) -> Result<RecordBatch, DeltaTableError>
pub fn add_actions_table( &self, flatten: bool, ) -> Result<RecordBatch, DeltaTableError>
Get an arrow::record_batch::RecordBatch containing add action data.
§Arguments
flatten
- whether to flatten the schema. Partition values columns are given the prefixpartition.
, statistics (null_count, min, and max) are given the prefixnull_count.
,min.
, andmax.
, and tags the prefixtags.
. Nested field names are concatenated with.
.
§Data schema
Each row represents a file that is a part of the selected tables state.
path
(String): relative or absolute to a file.size_bytes
(Int64): size of file in bytes.modification_time
(Millisecond Timestamp): time the file was created.data_change
(Boolean): false if data represents data moved from other files in the same transaction.partition.{partition column name}
(matches column type): value of partition the file corresponds to.null_count.{col_name}
(Int64): number of null values for column in this file.min.{col_name}
(matches column type): minimum value of column in file (if available).max.{col_name}
(matches column type): maximum value of column in file (if available).tag.{tag_key}
(String): value of a metadata tag for the file.
Source§impl DeltaTableState
impl DeltaTableState
Sourcepub fn datafusion_table_statistics(&self) -> Option<Statistics>
pub fn datafusion_table_statistics(&self) -> Option<Statistics>
Provide table level statistics to Datafusion
Trait Implementations§
Source§impl Clone for DeltaTableState
impl Clone for DeltaTableState
Source§fn clone(&self) -> DeltaTableState
fn clone(&self) -> DeltaTableState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl DataFusionMixins for DeltaTableState
impl DataFusionMixins for DeltaTableState
Source§fn arrow_schema(&self) -> DeltaResult<ArrowSchemaRef>
fn arrow_schema(&self) -> DeltaResult<ArrowSchemaRef>
Source§fn input_schema(&self) -> DeltaResult<ArrowSchemaRef>
fn input_schema(&self) -> DeltaResult<ArrowSchemaRef>
ArrowSchemaRef
Source§fn parse_predicate_expression(
&self,
expr: impl AsRef<str>,
df_state: &SessionState,
) -> DeltaResult<Expr>
fn parse_predicate_expression( &self, expr: impl AsRef<str>, df_state: &SessionState, ) -> DeltaResult<Expr>
Expr
Source§impl Debug for DeltaTableState
impl Debug for DeltaTableState
Source§impl<'de> Deserialize<'de> for DeltaTableState
impl<'de> Deserialize<'de> for DeltaTableState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PruningStatistics for DeltaTableState
impl PruningStatistics for DeltaTableState
Source§fn min_values(&self, column: &Column) -> Option<ArrayRef>
fn min_values(&self, column: &Column) -> Option<ArrayRef>
Source§fn max_values(&self, column: &Column) -> Option<ArrayRef>
fn max_values(&self, column: &Column) -> Option<ArrayRef>
Source§fn num_containers(&self) -> usize
fn num_containers(&self) -> usize
Source§fn null_counts(&self, column: &Column) -> Option<ArrayRef>
fn null_counts(&self, column: &Column) -> Option<ArrayRef>
UInt64Array
Read moreSource§fn row_counts(&self, column: &Column) -> Option<ArrayRef>
fn row_counts(&self, column: &Column) -> Option<ArrayRef>
UInt64Array
. Read moreSource§fn contained(
&self,
column: &Column,
values: &HashSet<ScalarValue>,
) -> Option<BooleanArray>
fn contained( &self, column: &Column, values: &HashSet<ScalarValue>, ) -> Option<BooleanArray>
BooleanArray
where each row represents information known
about specific literal values
in a column. Read moreSource§impl Serialize for DeltaTableState
impl Serialize for DeltaTableState
Source§impl TableReference for DeltaTableState
impl TableReference for DeltaTableState
Source§fn config(&self) -> TableConfig<'_>
fn config(&self) -> TableConfig<'_>
Source§fn eager_snapshot(&self) -> &EagerSnapshot
fn eager_snapshot(&self) -> &EagerSnapshot
EagerSnapshot
Auto Trait Implementations§
impl Freeze for DeltaTableState
impl !RefUnwindSafe for DeltaTableState
impl Send for DeltaTableState
impl Sync for DeltaTableState
impl Unpin for DeltaTableState
impl !UnwindSafe for DeltaTableState
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
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