matthewmturner commented on issue #696:
URL: https://github.com/apache/arrow-rs/issues/696#issuecomment-913013809
@alamb im playing around with the regexp_match function and struggling to
produce the expected results. I tried to do something similar to the test
`match_single_group`.
I have the following:
```
let array = StringArray::from(vec![Some("Animal"), None, Some("House")]);
let pat = StringArray::from(vec![r"^[A]"; 3]);
let m = regexp_match(&array, &pat, None).unwrap();
let result = m.as_any().downcast_ref::<ListArray>().unwrap();
let elem_builder: GenericStringBuilder<i32> = GenericStringBuilder::new(0);
let mut expected_builder = ListBuilder::new(elem_builder);
expected_builder.values().append_value("A").unwrap();
expected_builder.append(true).unwrap();
expected_builder.append(false).unwrap();
expected_builder.append(false).unwrap();
let expected = expected_builder.finish();
assert_eq!(&expected, result);
```
But get the following:
```
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `ListArray
[
StringArray
[
"A",
],
null,
null,
]`,
right: `ListArray
[
StringArray
[
],
null,
null,
]`', src/main.rs:54:5
```
It's not clear to me why the result StringArray at the first index of the
ListArray doesnt have "A" - its just an empty StringArray.
Any thoughts?
--
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]