You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kawadakk (via GitHub)" <gi...@apache.org> on 2025/02/20 08:38:59 UTC
[I] Row converter erases list lengths of `List(Null)` [arrow-rs]
kawadakk opened a new issue, #7164:
URL: https://github.com/apache/arrow-rs/issues/7164
**Describe the bug**
`RowConverter::convert_rows` always decodes `List(Null)` as empty lists.
**To Reproduce**
```rust
let mut builder = GenericListBuilder::<O, _>::new(NullBuilder::new());
builder.values().append_nulls(0);
builder.append(true);
builder.append(false);
builder.values().append_nulls(2);
builder.append(true);
let list = Arc::new(builder.finish()) as ArrayRef;
let d = list.data_type().clone();
let converter = RowConverter::new(vec![SortField::new(d.clone())]).unwrap();
let rows = converter.convert_columns(&[Arc::clone(&list)]).unwrap();
assert!(rows.row(0) > rows.row(1)); // [null] > null
assert!(rows.row(0) < rows.row(2)); // [null] < [null, null]
assert!(rows.row(1) < rows.row(2)); // null < [null, null]
let back = converter.convert_rows(&rows).unwrap();
assert_eq!(back.len(), 1);
back[0].to_data().validate_full().unwrap();
assert_eq!(&back[0], &list);
```
Adding the above code to `test_single_list` in `arrow-row/src/lib.rs` causes a test failure:
```
thread 'tests::test_list' panicked at arrow-row/src/lib.rs:2111:9:
assertion `left == right` failed
left: ListArray
[
NullArray(0),
null,
NullArray(0),
]
right: ListArray
[
NullArray(0),
null,
NullArray(2),
]
```
**Expected behavior**
Not panicking
**Additional context**
<!--
Add any other context about the problem here.
-->
--
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Row converter does not preserve list lengths of `List(Null)` [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #7164: Row converter does not preserve list lengths of `List(Null)`
URL: https://github.com/apache/arrow-rs/issues/7164
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Row converter does not preserve list lengths of `List(Null)` [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on issue #7164:
URL: https://github.com/apache/arrow-rs/issues/7164#issuecomment-3841902049
Whoops I should have searched the issues before creating a new one 😅
I'll close this one as duplicate as we have a PR linked to the other issue (and the other issue also links to the DataFusion issue)
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org