-
Notifications
You must be signed in to change notification settings - Fork 578
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
SqlSmith Bug hunt: Aggregate of Subquery results in panic #4434
Comments
Seems hash is just not implemented for subquery. Maybe let's implement all the derive(Hash, PartialEq, Eq) for Subquery and handle detection of subquery not unnested elsewhere. |
Similar to #4404 (comment), As for |
Here is a related minimal example. The subquery is an input to an aggregate. create table t1 (x int);
select min((select x from t1)) from t1;
I'm not sure if #4386 would help us unnest this case. Its running on a version of main before the Subquery::clone patch was applied, so its still producing the ::clone() error, but takes the same error producing code path as hash. The code path is as follows:
Originating in
Btw, as a side note, @marvenlee2486 , is it possible for the tool to output the backtrace alongside the error so we know what codepath is triggering the errors? |
We can run the output query starting from the definition of tables to the failing query when we compiled Alternatively, probably can try see if #4415 are able to do if, if no then stick with the first one |
I'd rather not to support subquery expr together with agg. It is far from just enabling |
@xiangjinwu I think agg of subquery is more or less rewritable as a subquery with agg. It may not always be true, however, for instance, agg of CTE, where we want to use CTE elsewhere. I think for CTE case we'd actually be pretty ok to support this, as we never need to unnest correlated vars from CTE, and for impl, we can evaluate CTE once (batch) or as mview (stream). Anw, I'll take a look if it's too difficult to support, if it is, I'll just emit error from bind_expr if agg expr contains_subquery |
cc @jon-chuang Are you still looking at this? |
There is 1 out of 512 query that show this error which previous attempt to run 512 test that doesn,t fail.
error.txt
it is error occur around here.
https://github.com/singularity-data/risingwave/blob/ae0388aeee470bb82b845e14df96220cf51e3d2a/src/frontend/src/expr/subquery.rs#L72
About hashing.
@xiangjinwu, Could you help me with this?
The text was updated successfully, but these errors were encountered: