You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++][Python] split_pattern_regex hangs forever on a pattern that matches the empty string #55842
Cause: SplitRegexFinder::Find in cpp/src/arrow/compute/kernels/scalar_string_ascii.cc can return an empty match at the current position. The split loop then continues from the end of that match, which is the same position, so it matches the same empty spot again forever.
For comparison, split_pattern with pattern="" raises ArrowInvalid: Empty separator, replace_substring_regex handles "a*" fine, and Python's re.split("", "abc") gives ['', 'a', 'b', 'c', ''].
Possible fixes: after an empty match, advance by one character (like Python's re.split), or raise an error like split_pattern does. I'm happy to send a PR for whichever is preferred.
Tested on pyarrow 26.0.1 (latest), Windows 11, Python 3.12. The same code is on main.
Activity