mateuszkj edited a comment on pull request #2128:
URL:
https://github.com/apache/arrow-datafusion/pull/2128#issuecomment-1083606926
Now it's failing with two NULLs at last arguments.
To Reproduce
```sql
SELECT concat_ws('|','a',NULL, NULL);
-- Result: a|
```
Expected behavior
```sql
SELECT concat_ws('|','a',NULL, NULL);
-- Result: a
```
I would suggest to append separator before pushing value. E.g.
```rust
let mut owned_string: String = "".to_owned();
let mut first = true;
for arg_index in 1..args.len() {
let arg = &args[arg_index];
if !arg.is_null(index) {
// if not first push separator
if !first {
owned_string.push_str(sep);
first = false;
}
owned_string.push_str(arg.value(index));
}
}
```
--
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]