apache / apache/datafusion

join statement with regex causes panic

Open
#16,252 3 comments 0 reactions 1 assignee Claimed by @chenkovsky View on GitHub
bug
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Describe the bug

Using regex functions or regex logical operators will result to overflow.

### To Reproduce

```
> CREATE EXTERNAL TABLE bigdata STORED AS CSV LOCATION 'bigdata.csv' OPTIONS ('has_header' 'true');
0 row(s) fetched.
Elapsed 0.007 seconds.

>
CREATE EXTERNAL TABLE find STORED AS CSV LOCATION 'find.csv' OPTIONS ('has_header' 'true');
0 row(s) fetched.
Elapsed 0.001 seconds.

>

select count(1) from bigdata;
+-----------------+
| count(Int64(1)) |
+-----------------+
| 2278791 |
+-----------------+
1 row(s) fetched.
Elapsed 0.023 seconds.

> select count(1) from find;
+-----------------+
| count(Int64(1)) |
+-----------------+
| 27 |
+-----------------+
1 row(s) fetched.
Elapsed 0.001 seconds.

>
select * from bigdata join find ON bigdata.a ~* find.regex;

thread 'tokio-runtime-worker' panicked at ..\index.crates.io-1949cf8c6b5b557f\arrow-select-55.1.0\src\take.rs:480:45:
overflow
```

### Expected behavior

_No response_

### Additional context

[data.zip](https://github.com/user-attachments/files/20595521/data.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.