adriangb opened a new issue, #12559:
URL: https://github.com/apache/arrow-rs/issues/12559
**Describe the bug**
`cast(&view_array, &DataType::Utf8)` panics instead of returning an error
when the total value length is larger than `i32::MAX`. `cast_view_to_byte`
already computes the total length, but it does not check it, so
`GenericByteBuilder::append_value` panics with `byte array offset overflow`.
The same happens for `BinaryView` to `Binary`.
For example, a DataFusion query `CAST(col AS VARCHAR) LIKE '%x%'` on a large
`Utf8View` column panics a query thread.
**To Reproduce**
Build a `StringViewArray` with 2049 views of a 1 MiB value that share one
buffer, then call `arrow_cast::cast(&arr, &DataType::Utf8)`.
**Expected behavior**
`Err(ArrowError::ComputeError("Offset overflow ..."))`, the same as the list
casts in `arrow-cast/src/cast/list.rs`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]