pub struct ClickHouseConnectionPool { /* private fields */ }Expand description
A wrapper around a clickhouse_arrow::ConnectionPool<ArrowFormat>
Implementations§
Source§impl ClickHouseConnectionPool
impl ClickHouseConnectionPool
Sourcepub fn new(identifier: impl Into<String>, pool: ArrowPool) -> Self
pub fn new(identifier: impl Into<String>, pool: ArrowPool) -> Self
Create a new ClickHouse connection pool for use in DataFusion. The identifier is used in
the case of federation to determine if queries can be pushed down across two pools
Sourcepub fn with_write_concurrency(self, concurrency: usize) -> Self
pub fn with_write_concurrency(self, concurrency: usize) -> Self
Set the write concurrency level for INSERT operations.
This controls how many record batches can be written to ClickHouse concurrently.
Higher values may improve throughput but increase memory and connection usage.
Default: 4 (matching clickhouse-arrow’s current connection pool limit)
Sourcepub fn write_concurrency(&self) -> usize
pub fn write_concurrency(&self) -> usize
Get the configured write concurrency level
Sourcepub async fn from_pool_builder(
builder: ArrowConnectionPoolBuilder,
) -> Result<Self>
pub async fn from_pool_builder( builder: ArrowConnectionPoolBuilder, ) -> Result<Self>
Create a new ClickHouse connection pool from a builder.
§Errors
- Returns an error if the connection pool cannot be created.
pub fn join_push_down(&self) -> JoinPushDown
Source§impl ClickHouseConnectionPool
impl ClickHouseConnectionPool
Sourcepub async fn connect(&self) -> Result<ClickHouseConnection<'_>>
pub async fn connect(&self) -> Result<ClickHouseConnection<'_>>
Get a managed ArrowPoolConnection wrapped in a ClickHouseConnection
§Errors
- Returns an error if the connection cannot be established.
Sourcepub async fn connect_static(&self) -> Result<ClickHouseConnection<'static>>
pub async fn connect_static(&self) -> Result<ClickHouseConnection<'static>>
Get a managed static ArrowPoolConnection wrapped in a ClickHouseConnection
§Errors
- Returns an error if the connection cannot be established.
Trait Implementations§
Source§impl Clone for ClickHouseConnectionPool
impl Clone for ClickHouseConnectionPool
Source§fn clone(&self) -> ClickHouseConnectionPool
fn clone(&self) -> ClickHouseConnectionPool
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ClickHouseConnectionPool
impl !RefUnwindSafe for ClickHouseConnectionPool
impl Send for ClickHouseConnectionPool
impl Sync for ClickHouseConnectionPool
impl Unpin for ClickHouseConnectionPool
impl !UnwindSafe for ClickHouseConnectionPool
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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