pub struct ImportBuilder<'a> { /* private fields */ }etl only.Expand description
A builder for an ETL IMPORT job.
This builder allows configuring various options for the IMPORT job, such as the
destination table, number of writers, and CSV formatting options.
Once configured, the ImportBuilder::build method will create the IMPORT query and return
a tuple containing the EtlQuery future and a Vec<ExaWriter> of workers. The future
must be awaited to drive the job to completion, while the workers are used to write the
data to be imported.
Implementations§
Source§impl<'a> ImportBuilder<'a>
impl<'a> ImportBuilder<'a>
pub fn new( dest_table: &'a str, dest_schema: Option<&'a str>, ) -> ImportBuilder<'a>
Sourcepub async fn build<'c>(
&'a self,
con: &'c mut ExaConnection,
) -> Result<(EtlQuery<'c>, Vec<ExaImport>), Error>where
'c: 'a,
pub async fn build<'c>(
&'a self,
con: &'c mut ExaConnection,
) -> Result<(EtlQuery<'c>, Vec<ExaImport>), Error>where
'c: 'a,
Builds the IMPORT job.
The output will be a future to await the result of the IMPORT query and the workers that
can be used for ETL IO.
§Errors
Returns an error if getting the nodes IPs from Exasol fails or if the worker sockets could not be connected.
Sourcepub fn num_writers(&mut self, num_writers: usize) -> &mut ImportBuilder<'a>
pub fn num_writers(&mut self, num_writers: usize) -> &mut ImportBuilder<'a>
Sets the number of writer jobs that will be started.
If set to 0, then as many as possible will be used (one per node). Providing a number
bigger than the number of nodes is the same as providing 0.
pub fn buffer_size(&mut self, buffer_size: usize) -> &mut ImportBuilder<'a>
pub fn compression(&mut self, enabled: bool) -> &mut ImportBuilder<'a>
compression only.pub fn columns( &mut self, columns: Option<&'a [&'a str]>, ) -> &mut ImportBuilder<'a>
pub fn comment(&mut self, comment: &'a str) -> &mut ImportBuilder<'a>
pub fn encoding(&mut self, encoding: &'a str) -> &mut ImportBuilder<'a>
pub fn null(&mut self, null: &'a str) -> &mut ImportBuilder<'a>
pub fn row_separator( &mut self, separator: RowSeparator, ) -> &mut ImportBuilder<'a>
pub fn column_separator(&mut self, separator: &'a str) -> &mut ImportBuilder<'a>
pub fn column_delimiter(&mut self, delimiter: &'a str) -> &mut ImportBuilder<'a>
pub fn skip(&mut self, num: u64) -> &mut ImportBuilder<'a>
pub fn trim(&mut self, trim: Trim) -> &mut ImportBuilder<'a>
Trait Implementations§
Source§impl<'a> Clone for ImportBuilder<'a>
impl<'a> Clone for ImportBuilder<'a>
Source§fn clone(&self) -> ImportBuilder<'a>
fn clone(&self) -> ImportBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ImportBuilder<'a>
impl<'a> RefUnwindSafe for ImportBuilder<'a>
impl<'a> Send for ImportBuilder<'a>
impl<'a> Sync for ImportBuilder<'a>
impl<'a> Unpin for ImportBuilder<'a>
impl<'a> UnwindSafe for ImportBuilder<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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