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

UNION ALL with null constants results in Schema error #13010

Open
alamb opened this issue Oct 18, 2024 · 1 comment · May be fixed by #12954
Open

UNION ALL with null constants results in Schema error #13010

alamb opened this issue Oct 18, 2024 · 1 comment · May be fixed by #12954
Labels
bug Something isn't working

Comments

@alamb
Copy link
Contributor

alamb commented Oct 18, 2024

Describe the bug

UNION ALL with null constants results in Schema error

To Reproduce

Run the following query from https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/test_files/metadata.slt

query T
select name from (
  SELECT nonnull_name as name FROM "table_with_metadata"
  UNION ALL
  SELECT NULL::string as name
) group by name order by name;
----
no_bar
no_baz
no_foo
NULL

It results with

External error: query failed: DataFusion error: Schema error: No field named nonnull_name. Valid fields are table_with_metadata.id, table_with_metadata.name, table_with_metadata.l_name. [SQL] select name from ( SELECT nonnull_name as name FROM "table_with_metadata" UNION ALL SELECT NULL::string as name ) group by name order by name; at test_files/metadata.slt:127 Error: Execution("1 failures") error: test failed, to rerun pass `-p datafusion-sqllogictest --test sqllogictests`

Expected behavior

Query should complete

Additional context

No response

@alamb alamb added the bug Something isn't working label Oct 18, 2024
@alamb
Copy link
Contributor Author

alamb commented Oct 18, 2024

@wiedld is working on this one I believe -- see #12954

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
1 participant