pub struct DeltaOps(pub DeltaTable);
Expand description
High level interface for executing commands against a DeltaTable
Tuple Fields§
§0: DeltaTable
Implementations§
Source§impl DeltaOps
impl DeltaOps
Sourcepub async fn try_from_uri(uri: impl AsRef<str>) -> DeltaResult<Self>
pub async fn try_from_uri(uri: impl AsRef<str>) -> DeltaResult<Self>
Create a new DeltaOps
instance, operating on DeltaTable
at given uri.
use deltalake_core::DeltaOps;
async {
let ops = DeltaOps::try_from_uri("memory://").await.unwrap();
};
Sourcepub async fn try_from_uri_with_storage_options(
uri: impl AsRef<str>,
storage_options: HashMap<String, String>,
) -> DeltaResult<Self>
pub async fn try_from_uri_with_storage_options( uri: impl AsRef<str>, storage_options: HashMap<String, String>, ) -> DeltaResult<Self>
try from uri with storage options
Sourcepub fn new_in_memory() -> Self
pub fn new_in_memory() -> Self
Create a new DeltaOps
instance, backed by an un-initialized in memory table
Using this will not persist any changes beyond the lifetime of the table object. The main purpose of in-memory tables is for use in testing.
use deltalake_core::DeltaOps;
let ops = DeltaOps::new_in_memory();
Sourcepub fn create(self) -> CreateBuilder
pub fn create(self) -> CreateBuilder
Create a new Delta table
use deltalake_core::DeltaOps;
async {
let ops = DeltaOps::try_from_uri("memory://").await.unwrap();
let table = ops.create().with_table_name("my_table").await.unwrap();
assert_eq!(table.version(), 0);
};
Sourcepub fn load_cdf(self) -> CdfLoadBuilder
pub fn load_cdf(self) -> CdfLoadBuilder
Load a table with CDF Enabled
Sourcepub fn write(
self,
batches: impl IntoIterator<Item = RecordBatch>,
) -> WriteBuilder
pub fn write( self, batches: impl IntoIterator<Item = RecordBatch>, ) -> WriteBuilder
Write data to Delta table
Sourcepub fn vacuum(self) -> VacuumBuilder
pub fn vacuum(self) -> VacuumBuilder
Vacuum stale files from delta table
Sourcepub fn filesystem_check(self) -> FileSystemCheckBuilder
pub fn filesystem_check(self) -> FileSystemCheckBuilder
Audit active files with files present on the filesystem
Sourcepub fn optimize<'a>(self) -> OptimizeBuilder<'a>
pub fn optimize<'a>(self) -> OptimizeBuilder<'a>
Audit active files with files present on the filesystem
Sourcepub fn delete(self) -> DeleteBuilder
pub fn delete(self) -> DeleteBuilder
Delete data from Delta table
Sourcepub fn update(self) -> UpdateBuilder
pub fn update(self) -> UpdateBuilder
Update data from Delta table
Sourcepub fn restore(self) -> RestoreBuilder
pub fn restore(self) -> RestoreBuilder
Restore delta table to a specified version or datetime
Sourcepub fn merge<E: Into<Expression>>(
self,
source: DataFrame,
predicate: E,
) -> MergeBuilder
pub fn merge<E: Into<Expression>>( self, source: DataFrame, predicate: E, ) -> MergeBuilder
Update data from Delta table
Sourcepub fn add_constraint(self) -> ConstraintBuilder
pub fn add_constraint(self) -> ConstraintBuilder
Add a check constraint to a table
Sourcepub fn add_feature(self) -> AddTableFeatureBuilder
pub fn add_feature(self) -> AddTableFeatureBuilder
Enable a table feature for a table
Sourcepub fn drop_constraints(self) -> DropConstraintBuilder
pub fn drop_constraints(self) -> DropConstraintBuilder
Drops constraints from a table
Sourcepub fn set_tbl_properties(self) -> SetTablePropertiesBuilder
pub fn set_tbl_properties(self) -> SetTablePropertiesBuilder
Set table properties
Sourcepub fn add_columns(self) -> AddColumnBuilder
pub fn add_columns(self) -> AddColumnBuilder
Add new columns
Trait Implementations§
Source§impl AsRef<DeltaTable> for DeltaOps
impl AsRef<DeltaTable> for DeltaOps
Source§fn as_ref(&self) -> &DeltaTable
fn as_ref(&self) -> &DeltaTable
Source§impl From<DeltaOps> for DeltaTable
impl From<DeltaOps> for DeltaTable
Source§impl From<DeltaTable> for DeltaOps
impl From<DeltaTable> for DeltaOps
Source§fn from(table: DeltaTable) -> Self
fn from(table: DeltaTable) -> Self
Auto Trait Implementations§
impl Freeze for DeltaOps
impl !RefUnwindSafe for DeltaOps
impl Send for DeltaOps
impl Sync for DeltaOps
impl Unpin for DeltaOps
impl !UnwindSafe for DeltaOps
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> 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