Struct arrow_odbc::BufferAllocationOptions
source · [−]pub struct BufferAllocationOptions {
pub max_text_size: Option<usize>,
pub max_binary_size: Option<usize>,
pub fallibale_allocations: bool,
}Expand description
Allows setting limits for buffers bound to the ODBC data source. Check this out if you find that
you get memory allocation, or zero sized column errors. Used than constructing a reader using
crate::OdbcReader::with.
Fields
max_text_size: Option<usize>An upper limit for the size of buffers bound to variadic text columns of the data source.
This limit does not (directly) apply to the size of the created arrow buffers, but rather
applies to the buffers used for the data in transit. Use this option if you have e.g.
VARCHAR(MAX) fields in your database schema. In such a case without an upper limit, the
ODBC driver of your data source is asked for the maximum size of an element, and is likely
to answer with either 0 or a value which is way larger than any actual entry in the column
If you can not adapt your database schema, this limit might be what you are looking for. On
windows systems the size is double words (16Bit), as windows utilizes an UTF-16 encoding. So
this translates to roughly the size in letters. On non windows systems this is the size in
bytes and the datasource is assumed to utilize an UTF-8 encoding. None means no upper
limit is set and the maximum element size, reported by ODBC is used to determine buffer
sizes.
max_binary_size: Option<usize>An upper limit for the size of buffers bound to variadic binary columns of the data source.
This limit does not (directly) apply to the size of the created arrow buffers, but rather
applies to the buffers used for the data in transit. Use this option if you have e.g.
VARBINARY(MAX) fields in your database schema. In such a case without an upper limit, the
ODBC driver of your data source is asked for the maximum size of an element, and is likely
to answer with either 0 or a value which is way larger than any actual entry in the
column. If you can not adapt your database schema, this limit might be what you are looking
for. This is the maximum size in bytes of the binary column.
fallibale_allocations: boolSet to true in order to trigger an ColumnFailure::TooLarge instead of a panic in case
the buffers can not be allocated due to their size. This might have a performance cost for
constructing the reader. false by default.
Trait Implementations
sourceimpl Clone for BufferAllocationOptions
impl Clone for BufferAllocationOptions
sourcefn clone(&self) -> BufferAllocationOptions
fn clone(&self) -> BufferAllocationOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for BufferAllocationOptions
impl Debug for BufferAllocationOptions
sourceimpl Default for BufferAllocationOptions
impl Default for BufferAllocationOptions
sourcefn default() -> BufferAllocationOptions
fn default() -> BufferAllocationOptions
Returns the “default value” for a type. Read more
impl Copy for BufferAllocationOptions
Auto Trait Implementations
impl RefUnwindSafe for BufferAllocationOptions
impl Send for BufferAllocationOptions
impl Sync for BufferAllocationOptions
impl Unpin for BufferAllocationOptions
impl UnwindSafe for BufferAllocationOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more