Skip to content

do not validate already valid arrow varbin arrays#7089

Merged
onursatici merged 1 commit intodevelopfrom
os/varbin-arrow
Mar 20, 2026
Merged

do not validate already valid arrow varbin arrays#7089
onursatici merged 1 commit intodevelopfrom
os/varbin-arrow

Conversation

@onursatici
Copy link
Contributor

Summary

varbin::try_new validates every element of the input array, but for arrow arrays this is already validated, so we can skip validation.

This validation can take longer than compressing and writing the entire array into disk.

on varbinview this is already fixed and we skip validation correctly

Signed-off-by: Onur Satici <onur@spiraldb.com>
@@ -275,12 +275,15 @@ where
DataType::Utf8 | DataType::LargeUtf8 => DType::Utf8(nullable.into()),
dt => vortex_panic!("Invalid data type for ByteArray: {dt}"),
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least to a debug assert here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new_unchecked has this under new_unchecked_from_handle:

        #[cfg(debug_assertions)]
        Self::validate(&offsets, &bytes, &dtype, &validity)
            .vortex_expect("[Debug Assertion]: Invalid `VarBinArray` parameters");

so we already have dbg assert validate here

@onursatici onursatici added the changelog/performance A performance improvement label Mar 20, 2026
@onursatici onursatici enabled auto-merge (squash) March 20, 2026 17:54
@onursatici onursatici merged commit 062f36c into develop Mar 20, 2026
105 of 107 checks passed
@onursatici onursatici deleted the os/varbin-arrow branch March 20, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants