Skip to main content

max_child_capacity

Function max_child_capacity 

Source
pub unsafe fn max_child_capacity(vector: duckdb_vector) -> usize
Expand description

The most child elements a LIST or MAP vector’s child can be reserved for without DuckDB throwing through the C API.

That is the largest power of two whose elements fit in MAX_LIST_CHILD_CAPACITY bytes in the widest buffer the child’s type grows (see MAX_LIST_CHILD_CAPACITY); DuckDB rounds a reservation up to a power of two before it checks the size. 2^34 for BIGINT, 2^33 for VARCHAR, 2^25 for INTEGER[1000].

ListBuilder applies it by itself; call this before ListVector::reserve or MapVector::reserve.

§Safety

vector must be a valid LIST or MAP vector.