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

Panics in MIN()/MAX() aggregate functions (SQLancer) #12011

Closed
2010YOUY01 opened this issue Aug 15, 2024 · 3 comments · Fixed by #12016
Closed

Panics in MIN()/MAX() aggregate functions (SQLancer) #12011

2010YOUY01 opened this issue Aug 15, 2024 · 3 comments · Fixed by #12016
Labels
bug Something isn't working

Comments

@2010YOUY01
Copy link
Contributor

2010YOUY01 commented Aug 15, 2024

Describe the bug

See reproducer in datafusion-cli

DataFusion CLI v41.0.0
> select min(1,2);
thread 'main' panicked at /Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/functions-aggregate/src/min_max.rs:71:5:
assertion `left == right` failed
  left: 2
 right: 1
DataFusion CLI v41.0.0
> select max(2,1);
thread 'main' panicked at /Users/yongting/Desktop/code/my_datafusion/arrow-datafusion/datafusion/functions-aggregate/src/min_max.rs:71:5:
assertion `left == right` failed
  left: 2
 right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce

No response

Expected behavior

Note those queries are invalid since MIN/MAX only takes one argument, but it should still return an error instead of crash

Additional context

Found by SQLancer #11030

@2010YOUY01 2010YOUY01 added the bug Something isn't working label Aug 15, 2024
@jayzhan211
Copy link
Contributor

Both postgres and duckdb does not support min/max more than one argument. I suggest we leave it alone too.

@tlm365
Copy link
Contributor

tlm365 commented Aug 15, 2024

Both postgres and duckdb does not support min/max more than one argument. I suggest we leave it alone too.

I have the same thought, but I think it would be nice if we throw an error with a message instead of panic and crash.

@2010YOUY01
Copy link
Contributor Author

Both postgres and duckdb does not support min/max more than one argument. I suggest we leave it alone too.

I have updated the issue for clarification (expecting an error instead of crash)
BTW I think this is introduced by a recent change

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

Successfully merging a pull request may close this issue.

3 participants