Skip to content

Conversation

Mytherin
Copy link
Collaborator

This makes UNION BY NAME work with types that are not implicitly castable to one another, which is the same behavior that UNION ALL has.

@Tishj
Copy link
Contributor

Tishj commented Apr 16, 2024

I did some tests with structs:

select {'a': 'hello'} as c union all by name select {'b': 'hello'} as c;
select {'a': 'hello'} as c union all by name select {'a': 'hello', 'b': 'world'} as c;

Which error as expected

And this works, also expected:

query I
select {'a': '0'} as c union all by name select {'a': 0} as c
----
{'a': 0}
{'a': 0}

@duckdb-draftbot duckdb-draftbot marked this pull request as draft April 16, 2024 10:03
@Mytherin Mytherin marked this pull request as ready for review April 16, 2024 10:15
@Mytherin Mytherin merged commit 49ea721 into duckdb:main Apr 16, 2024
github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Apr 16, 2024
Merge pull request duckdb/duckdb#11665 from Mytherin/unionbynametypes
@Mytherin Mytherin deleted the unionbynametypes branch June 7, 2024 12:52
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 this pull request may close these issues.

2 participants