Skip to main content

PartitionParser

Trait PartitionParser 

Source
pub trait PartitionParser<'a>: Send {
    type TypeSystem: TypeSystem;
    type Error: From<ConnectorXError> + Send + Debug;

    // Required method
    fn fetch_next(&mut self) -> Result<(usize, bool), Self::Error>;

    // Provided method
    fn parse<'r, T>(
        &'r mut self,
    ) -> Result<T, <Self as PartitionParser<'a>>::Error>
       where T: TypeAssoc<Self::TypeSystem>,
             Self: Produce<'r, T, Error = <Self as PartitionParser<'a>>::Error> { ... }
}
Expand description

A PartitionParser reads the values of one partition’s result, one cell at a time.

The dispatcher calls fetch_next to buffer a batch of rows, then parse once per cell in the negotiated DataOrder. Each cell’s type comes from the source schema.

Required Associated Types§

Source

type TypeSystem: TypeSystem

The type system of the parent Source.

Source

type Error: From<ConnectorXError> + Send + Debug

The error type of the parent Source.

Required Methods§

Source

fn fetch_next(&mut self) -> Result<(usize, bool), Self::Error>

Fetch next batch of rows from database, return (number of rows fetched to local, whether all rows are fechted from database). There might be rows that are not consumed yet when calling the next fetch_next. The function might be called even after the last batch is fetched.

Provided Methods§

Source

fn parse<'r, T>(&'r mut self) -> Result<T, <Self as PartitionParser<'a>>::Error>
where T: TypeAssoc<Self::TypeSystem>, Self: Produce<'r, T, Error = <Self as PartitionParser<'a>>::Error>,

Read a value T by calling Produce<T>::produce. Usually this function does not need to be implemented.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl PartitionParser<'_> for PostgresSimpleSourceParser

Source§

impl<'a> PartitionParser<'a> for BigQuerySourceParser

Source§

impl<'a> PartitionParser<'a> for CSVSourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for ClickHouseSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for DummySourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for MsSQLSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for MySQLBinarySourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for MySQLTextSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for OracleTextSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for PostgresBinarySourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for PostgresCSVSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for PostgresRawSourceParser<'a>

Source§

impl<'a> PartitionParser<'a> for SQLiteSourcePartitionParser<'a>

Source§

impl<'a> PartitionParser<'a> for TrinoSourcePartitionParser<'a>