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

Correlated group on ANY subquery #2999

Closed
2 tasks done
PedroTadim opened this issue Jan 27, 2022 · 4 comments · Fixed by #3012
Closed
2 tasks done

Correlated group on ANY subquery #2999

PedroTadim opened this issue Jan 27, 2022 · 4 comments · Fixed by #3012
Assignees

Comments

@PedroTadim
Copy link
Contributor

What happens?

While this subquery crashes on MonetDB, it gives error on DuckDB :) The dependent join unnesting is not available for the ANY operator. If you consider this as a feature, please close the issue.

To Reproduce

CREATE TABLE t0 (c0 INT);
CREATE TABLE t1 (c0 INT);
INSERT INTO t0 VALUES (1);
INSERT INTO t1 VALUES (1);

SELECT 1 = ANY(SELECT 1 FROM t1 JOIN (SELECT count(*) GROUP BY t0.c0) AS x(x) ON TRUE) FROM t0;
Error: INTERNAL Error: Logical operator type "ANY_JOIN" for dependent join

Environment (please complete the following information):

  • OS: Linux
  • DuckDB Version: downloaded and compiled from the tip of master branch
  • DuckDB Client: Shell

Before Submitting

  • Have you tried this on the latest master branch?
  • Python: pip install duckdb --upgrade --pre
  • R: install.packages("https://github.com/duckdb/duckdb/releases/download/master-builds/duckdb_r_src.tar.gz", repos = NULL)
  • Other Platforms: You can find binaries here or compile from source.
  • Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
@PedroTadim
Copy link
Contributor Author

I fixed the crash in MonetDB and now it runs there😇

@hannes
Copy link
Member

hannes commented Jan 28, 2022

It should not throw an internal error, so there is probably a bug here. Thanks for reporting.

@Mytherin
Copy link
Collaborator

Thanks for the report! I have pushed a fix in #3012.

@Mytherin
Copy link
Collaborator

It should not throw an internal error, so there is probably a bug here. Thanks for reporting.

Indeed as Hannes mentioned any internal exception being thrown is considered a bug, so please file any you find :)

@hawkfish hawkfish added the bug label Jan 31, 2022
Mytherin added a commit that referenced this issue Feb 1, 2022
Fix #2999: Support ANY_JOIN in flattening correlated subqueries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants