Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic in scalar function approx_percentile_cont_with_weight (SQLancer) #12716

Open
2010YOUY01 opened this issue Oct 2, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@2010YOUY01
Copy link
Contributor

Describe the bug

See the reproducer in datafusion-cli (compiled from the latest main, commit 0242767)

DataFusion CLI v42.0.0
> create table t1(v1 bool);
0 row(s) fetched.
Elapsed 0.065 seconds.

> insert into t1 values (true);
+-------+
| count |
+-------+
| 1     |
+-------+
1 row(s) fetched.
Elapsed 0.040 seconds.

> select approx_percentile_cont_with_weight('NaN'::Double, 0, 0) from t1 where t1.v1;
thread 'main' panicked at /Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/functions-aggregate-common/src/tdigest.rs:647:9:
assertion failed: max.total_cmp(&min).is_ge()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce

No response

Expected behavior

It won't cause panic if from ... where ... is removed

DataFusion CLI v42.0.0
> select approx_percentile_cont_with_weight('NaN'::Double, 0, 0);
+-------------------------------------------------------------------+
| approx_percentile_cont_with_weight(Utf8("NaN"),Int64(0),Int64(0)) |
+-------------------------------------------------------------------+
| inf                                                               |
+-------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.099 seconds.

Additional context

Found by SQLancer #11030

@2010YOUY01 2010YOUY01 added the bug Something isn't working label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant