fn check_string_capacity(
current_len: i32,
space_needed: Option<i32>,
limit: i32,
) -> Result<bool>Expand description
Checks whether a string field builder that currently holds current_len bytes can
additionally accommodate space_needed bytes of string data, given that the offset of a
single Arrow string array is limited to limit (i32::MAX in production).
Returns:
Ok(true)ifcurrent_len + space_needed <= limit;Ok(false)ifspace_needed <= limitbutcurrent_len + space_needed > limit, i.e. the current builder is too full but an empty builder could accommodate the batch (the caller may freeze the current builder and replay the batch onto an empty one);Err(InvalidBatchSnafu)if the batch’s string data alone (space_needed, or the fact that its total bytes cannot even be represented asi32) exceedslimit, i.e. the batch can never be accommodated by any builder.