pub struct Utf8PartitionedTableWriter<PartitionWriter: TableWriter + Send> { /* private fields */ }Expand description
Wraps a set of TableWriter in such a way that they each write to a different
base/<partition_key>/x.parquet instead of base/x.parquet, where <partition_key>
is a UTF8 column.
This allows Hive partitioning while writing with multiple threads (x is the
thread id in the example above).
Implementations§
Source§impl<PartitionWriter: TableWriter + Send> Utf8PartitionedTableWriter<PartitionWriter>
impl<PartitionWriter: TableWriter + Send> Utf8PartitionedTableWriter<PartitionWriter>
pub fn partition( &mut self, partition_key: String, ) -> Result<&mut PartitionWriter>
pub fn partitions(&mut self) -> &mut HashMap<String, PartitionWriter>
Trait Implementations§
Source§impl<PartitionWriter: TableWriter + Send> TableWriter for Utf8PartitionedTableWriter<PartitionWriter>
impl<PartitionWriter: TableWriter + Send> TableWriter for Utf8PartitionedTableWriter<PartitionWriter>
Source§type Schema = (String, <PartitionWriter as TableWriter>::Schema)
type Schema = (String, <PartitionWriter as TableWriter>::Schema)
(partition_column, num_partitions, underlying_schema)
type CloseResult = Vec<<PartitionWriter as TableWriter>::CloseResult>
type Config = <PartitionWriter as TableWriter>::Config
fn new( path: PathBuf, (partition_column, schema): Self::Schema, config: Self::Config, ) -> Result<Self>
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Calls
.into() on the internal builder, and writes its result to disk.fn close(self) -> Result<Self::CloseResult>
Auto Trait Implementations§
impl<PartitionWriter> Freeze for Utf8PartitionedTableWriter<PartitionWriter>where
<PartitionWriter as TableWriter>::Schema: Freeze,
<PartitionWriter as TableWriter>::Config: Freeze,
impl<PartitionWriter> RefUnwindSafe for Utf8PartitionedTableWriter<PartitionWriter>where
<PartitionWriter as TableWriter>::Schema: RefUnwindSafe,
<PartitionWriter as TableWriter>::Config: RefUnwindSafe,
PartitionWriter: RefUnwindSafe,
impl<PartitionWriter> Send for Utf8PartitionedTableWriter<PartitionWriter>where
<PartitionWriter as TableWriter>::Schema: Send,
<PartitionWriter as TableWriter>::Config: Send,
impl<PartitionWriter> Sync for Utf8PartitionedTableWriter<PartitionWriter>where
<PartitionWriter as TableWriter>::Schema: Sync,
<PartitionWriter as TableWriter>::Config: Sync,
PartitionWriter: Sync,
impl<PartitionWriter> Unpin for Utf8PartitionedTableWriter<PartitionWriter>where
<PartitionWriter as TableWriter>::Schema: Unpin,
<PartitionWriter as TableWriter>::Config: Unpin,
PartitionWriter: Unpin,
impl<PartitionWriter> UnsafeUnpin for Utf8PartitionedTableWriter<PartitionWriter>where
<PartitionWriter as TableWriter>::Schema: UnsafeUnpin,
<PartitionWriter as TableWriter>::Config: UnsafeUnpin,
impl<PartitionWriter> UnwindSafe for Utf8PartitionedTableWriter<PartitionWriter>where
<PartitionWriter as TableWriter>::Schema: UnwindSafe,
<PartitionWriter as TableWriter>::Config: UnwindSafe,
PartitionWriter: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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> 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 more