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

Internal error in approx_percentile_cont() aggregate function (SQLancer) #12012

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

Internal error in approx_percentile_cont() aggregate function (SQLancer) #12012

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

Comments

@2010YOUY01
Copy link
Contributor

2010YOUY01 commented Aug 15, 2024

Describe the bug

Reproducer:

  1. Run datafusion-cli under latest main branch
(base) arrow-datafusion/datafusion-cli|main🌝| >>> git pull public main
From https://github.com/apache/arrow-datafusion
 * branch                main       -> FETCH_HEAD
Already up to date.
(base) arrow-datafusion/datafusion-cli|main🌝| >>> git checkout 2a16704db

...

(base) arrow-datafusion/datafusion-cli|2a16704db🌝| >>> cargo run
  1. Execute queries
DataFusion CLI v41.0.0
> create table t1(v1 double);
0 row(s) fetched.
Elapsed 0.078 seconds.

> select approx_percentile_cont(v1,v1) from t1;
Internal error: PhysicalExpr Column references column 'v1' at index 0 (zero-based) but input schema only has 0 columns: [].
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

I think this query is invalid, the second argument have to be a literal number instead of column reference, to make this query meaningful.
However an internal error should not be thrown, it always represent a potential bug in DataFusion.
So we have to further investigate if it's a actual bug or misused internal error

To Reproduce

No response

Expected behavior

No response

Additional context

Found by SQLancer #11030

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

goldmedal commented Aug 17, 2024

I tried to reproduce this bug but I got a different error message:

DataFusion CLI v41.0.0
> create table t1(v1 double);
0 row(s) fetched. 
Elapsed 0.003 seconds.

> select approx_percentile_cont(v1,v1) from t1;
Schema error: No field named t1.v1.

Although the error message is weird 🤔, I didn't get the internal error.
BTW, I used the latest datafusion-cli 41.0.0 installed by Homebrew.

@2010YOUY01
Copy link
Contributor Author

I tried to reproduce this bug but I got a different error message:

DataFusion CLI v41.0.0
> create table t1(v1 double);
0 row(s) fetched. 
Elapsed 0.003 seconds.

> select approx_percentile_cont(v1,v1) from t1;
Schema error: No field named t1.v1.

Although the error message is weird 🤔, I didn't get the internal error. BTW, I used the latest datafusion-cli 41.0.0 installed by Homebrew.

I'm running datafusion-cli under latest main, looks like this internal error was introduced by a very recent change 🤔
I have also updated the issue to specify the commit hash, I will make this clear for future bug reports

@goldmedal
Copy link
Contributor

take

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.

2 participants