pub struct Writer { /* private fields */ }Expand description
Appends pages and commits a new directory for one table.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn create(
path: impl AsRef<Path>,
name: impl Into<String>,
fields: Vec<Field>,
) -> Result<Self>
pub fn create( path: impl AsRef<Path>, name: impl Into<String>, fields: Vec<Field>, ) -> Result<Self>
Creates a new v10 file and its first table.
§Errors
If the file exists, a field has no scalar encoding, or the path cannot be written.
Sourcepub fn append(&mut self, chunk: &Chunk) -> Result<()>
pub fn append(&mut self, chunk: &Chunk) -> Result<()>
Writes one chunk as independently readable column pages.
§Errors
If its width or types differ from the declared table, or a page exceeds its bound.
Sourcepub fn append_at(&mut self, order: (u64, u64), chunk: &Chunk) -> Result<()>
pub fn append_at(&mut self, order: (u64, u64), chunk: &Chunk) -> Result<()>
Writes one chunk and records its source position for directory ordering.
Pages may be encoded by parallel pipeline instances and reach the file in completion order.
The stripe they land in is sorted by this key at commit, and Self::finish rejects a
sequence whose parts do not come out in source order once the stripes are sorted, because a
stripe groups whatever arrived together and cannot put a late part back where it belongs.
§Errors
The same as Self::append.