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

Error occurs when using union in query #2083

Closed
Ted-Jiang opened this issue Mar 25, 2022 · 4 comments · Fixed by #2334
Closed

Error occurs when using union in query #2083

Ted-Jiang opened this issue Mar 25, 2022 · 4 comments · Fixed by #2334
Labels
bug Something isn't working

Comments

@Ted-Jiang
Copy link
Member

Describe the bug
in pg

postgres=# select 1 union select 2;
 ?column?
----------
        1
        2
(2 rows)

in df

❯ select 1;
+----------+
| Int64(1) |
+----------+
| 1        |
+----------+
1 row in set. Query took 0.002 seconds.
❯ select 2;
+----------+
| Int64(2) |
+----------+
| 2        |
+----------+
1 row in set. Query took 0.001 seconds.
❯ select 1 union select 2;
Plan("UNION ALL schemas are expected to be the same")

I think there two problems:

  1. can not get result.
  2. use union but get UNION ALL: i think they are totaly different

related to #2032
To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@Ted-Jiang Ted-Jiang added the bug Something isn't working label Mar 25, 2022
@Ted-Jiang
Copy link
Member Author

I will try to fix this😊

@xudong963
Copy link
Member

@Ted-Jiang I think there is a duplicate issue: #1818

@Ted-Jiang
Copy link
Member Author

@Ted-Jiang I think there is a duplicate issue: #1818

Thanks for your info❤️

@gandronchik
Copy link
Contributor

It doesn't work in the current version.
select 1 union select 2;
ArrowError(ExternalError(Execution("Arrow error: External error: Internal error: Unsupported data type in hasher: Null. 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")))

SELECT 1 a UNION ALL SELECT 2;

+-------------+
| placeholder |
+-------------+
|             |
| 1           |
+-------------+

I fixed it. Now result is:
select 1 union select 2;

+----------+
| Int64(1) |
+----------+
| 2        |
| 1        |
+----------+

SELECT 1 a UNION ALL SELECT 2;

+---+
| a |
+---+
| 1 |
| 2 |
+---+

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