andygrove opened a new issue, #2631:
URL: https://github.com/apache/datafusion-comet/issues/2631
### Describe the bug
I found this issue during fuzz testing:
```sql
SELECT str, lpad(str, len % 10, 'x') FROM t1 ORDER BY str
```
Test data:
```scala
val schema = StructType(
Seq(
StructField("str", DataTypes.StringType, true),
StructField("len", DataTypes.IntegerType, true),
StructField("pad", DataTypes.StringType, true)))
val df = FuzzDataGenerator.generateDataFrame(r, spark, schema, 100,
DataGenOptions())
df.createOrReplaceTempView("t1")
```
Causes:
```
Job aborted due to stage failure: Task 3 in stage 28.0 failed 1 times, most
recent failure: Lost task 3.0 in stage 28.0 (TID 80) (woody.lan executor
driver): org.apache.comet.CometNativeException: capacity overflow
at comet::errors::init::{{closure}}(./native/core/src/errors.rs:151)
at <alloc::boxed::Box<F,A> as
core::ops::function::Fn<Args>>::call(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/alloc/src/boxed.rs:1985)
at
std::panicking::rust_panic_with_hook(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:841)
at
std::panicking::begin_panic_handler::{{closure}}(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:699)
at
std::sys::backtrace::__rust_end_short_backtrace(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/backtrace.rs:174)
at
__rustc::rust_begin_unwind(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs:697)
at
core::panicking::panic_fmt(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/panicking.rs:75)
at
alloc::raw_vec::capacity_overflow(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/alloc/src/raw_vec/mod.rs:29)
at
alloc::raw_vec::handle_error(/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/alloc/src/raw_vec/mod.rs:797)
at
alloc::raw_vec::RawVecInner<A>::reserve::do_reserve_and_handle(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:558)
at
alloc::raw_vec::RawVecInner<A>::reserve(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:563)
at
alloc::raw_vec::RawVec<T,A>::reserve(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:331)
at
alloc::vec::Vec<T,A>::reserve(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:1339)
at
alloc::string::String::reserve(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:1214)
at <alloc::string::String as
core::iter::traits::collect::Extend<char>>::extend(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:2406)
at <alloc::string::String as
core::iter::traits::collect::FromIterator<char>>::from_iter(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:2326)
at
core::iter::traits::iterator::Iterator::collect(/home/andy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2027)
at
datafusion_comet_spark_expr::static_invoke::char_varchar_utils::read_side_padding::add_padding_string(./native/spark-expr/src/static_invoke/char_varchar_utils/read_side_padding.rs:275)
```
### Steps to reproduce
_No response_
### Expected behavior
_No response_
### Additional context
_No response_
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]