Skip to main content

Utf8PartitionedTableWriter

Struct Utf8PartitionedTableWriter 

Source
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>

Source

pub fn partition( &mut self, partition_key: String, ) -> Result<&mut PartitionWriter>

Source

pub fn partitions(&mut self) -> &mut HashMap<String, PartitionWriter>

Trait Implementations§

Source§

impl<PartitionWriter: TableWriter + Send> TableWriter for Utf8PartitionedTableWriter<PartitionWriter>

Source§

type Schema = (String, <PartitionWriter as TableWriter>::Schema)

(partition_column, num_partitions, underlying_schema)

Source§

type CloseResult = Vec<<PartitionWriter as TableWriter>::CloseResult>

Source§

type Config = <PartitionWriter as TableWriter>::Config

Source§

fn new( path: PathBuf, (partition_column, schema): Self::Schema, config: Self::Config, ) -> Result<Self>

Source§

fn flush(&mut self) -> Result<()>

Calls .into() on the internal builder, and writes its result to disk.
Source§

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§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.