pub struct PositionDeleteFileWriter<B: FileWriterBuilder> { /* private fields */ }Expand description
Writer used to write position delete files.
Position delete files mark specific rows in data files as deleted by their position (row number). The schema is fixed with two columns:
- file_path: The path to the data file
- pos: The row position (0-indexed) in that file
§Example
use std::sync::Arc;
use arrow_array::{RecordBatch, StringArray, Int64Array};
use iceberg::spec::DataFileFormat;
use iceberg::writer::base_writer::position_delete_writer::{
PositionDeleteFileWriterBuilder, PositionDeleteWriterConfig
};
use iceberg::writer::file_writer::ParquetWriterBuilder;
use iceberg::writer::IcebergWriterBuilder;
// Create position delete writer
let config = PositionDeleteWriterConfig::new(None, 0, None);
let mut writer = PositionDeleteFileWriterBuilder::new(parquet_builder, config)
.build()
.await?;
// Write delete records
let file_paths = StringArray::from(vec!["s3://bucket/data/file1.parquet"]);
let positions = Int64Array::from(vec![42]); // Delete row 42
let batch = RecordBatch::try_new(
PositionDeleteWriterConfig::arrow_schema(),
vec![Arc::new(file_paths), Arc::new(positions)],
)?;
writer.write(batch).await?;
let data_files = writer.close().await?;Trait Implementations§
Source§impl<B: Debug + FileWriterBuilder> Debug for PositionDeleteFileWriter<B>
impl<B: Debug + FileWriterBuilder> Debug for PositionDeleteFileWriter<B>
Source§impl<B: FileWriterBuilder> IcebergWriter for PositionDeleteFileWriter<B>
impl<B: FileWriterBuilder> IcebergWriter for PositionDeleteFileWriter<B>
Source§fn write<'life0, 'async_trait>(
&'life0 mut self,
batch: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn write<'life0, 'async_trait>(
&'life0 mut self,
batch: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write data to iceberg table.
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<DataFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<DataFile>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the writer and return the written data files.
If close failed, the data written before maybe be lost. User may need to recreate the writer and rewrite the data again. Read more
Auto Trait Implementations§
impl<B> Freeze for PositionDeleteFileWriter<B>
impl<B> RefUnwindSafe for PositionDeleteFileWriter<B>
impl<B> Send for PositionDeleteFileWriter<B>
impl<B> Sync for PositionDeleteFileWriter<B>
impl<B> Unpin for PositionDeleteFileWriter<B>
impl<B> UnwindSafe for PositionDeleteFileWriter<B>
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> Downcast for T
impl<T> Downcast for 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more