clojurians-org opened a new issue, #2260:
URL: https://github.com/apache/arrow-datafusion/issues/2260
**Describe the bug**
```
index out of bounds: the len is 0 but the index is 0
```
**To Reproduce**
``` rust
context.register_udf(create_udf(
"database", vec![], Arc::new(DataType::Utf8),
Volatility::Volatile,
Arc::new(move |args: &[ColumnarValue]| {
let len: usize = match &args[0] {
ColumnarValue::Array(array) => array.len(),
_ => {
return Err(DataFusionError::Internal(
"Expect random function to take no
param".to_string(),
))
}
};
let values = std::iter::repeat_with(||
"default").take(len) ;
let array = StringArray::from_iter_values(values) ;
Ok(ColumnarValue::Array(Arc::new(array)))
})
)) ;
```
**Expected behavior**
**Additional context**
```
arrow = "9.0"
datafusion = "7.0"
```
--
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]