pub struct Writer { /* private fields */ }Expand description
A writer for the Lance v2.3 file grammar.
The concrete writer owns the v2.3 encoding composition, finish ordering, and exact footer identity. Shared components only execute the structural encoding and I/O mechanisms selected here.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn try_new(
object_writer: Box<dyn ObjectWriter>,
schema: Schema,
options: FileWriterOptions,
) -> Result<Self>
pub fn try_new( object_writer: Box<dyn ObjectWriter>, schema: Schema, options: FileWriterOptions, ) -> Result<Self>
Create a v2.3 writer with an explicit schema.
Sourcepub fn try_new_with_compression(
object_writer: Box<dyn ObjectWriter>,
schema: Schema,
options: FileWriterOptions,
compression: CompressionParams,
) -> Result<Self>
pub fn try_new_with_compression( object_writer: Box<dyn ObjectWriter>, schema: Schema, options: FileWriterOptions, compression: CompressionParams, ) -> Result<Self>
Create a v2.3 writer with explicit compression tuning.
Sourcepub fn new_lazy(
object_writer: Box<dyn ObjectWriter>,
options: FileWriterOptions,
) -> Self
pub fn new_lazy( object_writer: Box<dyn ObjectWriter>, options: FileWriterOptions, ) -> Self
Create a v2.3 writer whose schema is inferred from the first batch.
Sourcepub fn new_lazy_with_compression(
object_writer: Box<dyn ObjectWriter>,
options: FileWriterOptions,
compression: CompressionParams,
) -> Self
pub fn new_lazy_with_compression( object_writer: Box<dyn ObjectWriter>, options: FileWriterOptions, compression: CompressionParams, ) -> Self
Create a lazy v2.3 writer with explicit compression tuning.
Sourcepub fn with_page_metadata_spill(
self,
object_store: Arc<ObjectStore>,
path: Path,
) -> Self
pub fn with_page_metadata_spill( self, object_store: Arc<ObjectStore>, path: Path, ) -> Self
Spill page metadata to a sidecar file instead of retaining it in memory.
Sourcepub async fn write_batches(
&mut self,
batches: impl Iterator<Item = &RecordBatch>,
) -> Result<()>
pub async fn write_batches( &mut self, batches: impl Iterator<Item = &RecordBatch>, ) -> Result<()>
Schedule batches to be written in iteration order.
Sourcepub async fn write_batch(&mut self, batch: &RecordBatch) -> Result<()>
pub async fn write_batch(&mut self, batch: &RecordBatch) -> Result<()>
Schedule one record batch for writing.
Sourcepub async fn write_column(
&mut self,
column_index: usize,
array: ArrayRef,
) -> Result<()>
pub async fn write_column( &mut self, column_index: usize, array: ArrayRef, ) -> Result<()>
Write one top-level field, advancing only that field’s row count.
Sourcepub async fn write_external_buffer(
&mut self,
bytes: &[u8],
) -> Result<(u64, u64)>
pub async fn write_external_buffer( &mut self, bytes: &[u8], ) -> Result<(u64, u64)>
Append a buffer whose page or column metadata is supplied externally.
Sourcepub fn add_schema_metadata(
&mut self,
key: impl Into<String>,
value: impl Into<String>,
)
pub fn add_schema_metadata( &mut self, key: impl Into<String>, value: impl Into<String>, )
Add an entry to the schema metadata written in the file descriptor.
Sourcepub fn initialize_with_external_metadata(
&mut self,
schema: Schema,
column_metadata: Vec<ColumnMetadata>,
rows_written: u64,
)
pub fn initialize_with_external_metadata( &mut self, schema: Schema, column_metadata: Vec<ColumnMetadata>, rows_written: u64, )
Prepare the writer for encoded column data produced externally.
Sourcepub async fn add_global_buffer(&mut self, buffer: Bytes) -> Result<u32>
pub async fn add_global_buffer(&mut self, buffer: Bytes) -> Result<u32>
Add an arbitrary global buffer and return its one-based index.
Sourcepub async fn finish(&mut self) -> Result<FileWriteSummary>
pub async fn finish(&mut self) -> Result<FileWriteSummary>
Finish the v2.3 file and close its object writer.
Sourcepub fn field_id_to_column_indices(&self) -> &[(u32, u32)]
pub fn field_id_to_column_indices(&self) -> &[(u32, u32)]
Return the field-id to physical-column mapping selected by v2.3.
Auto Trait Implementations§
impl !RefUnwindSafe for Writer
impl !Sync for Writer
impl !UnwindSafe for Writer
impl Freeze for Writer
impl Send for Writer
impl Unpin for Writer
impl UnsafeUnpin for Writer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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