Skip to content

feat: Implement UNION ALL BY NAME #14538

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

Merged
merged 8 commits into from
Feb 17, 2025
Merged

Conversation

rkrishn7
Copy link
Contributor

@rkrishn7 rkrishn7 commented Feb 7, 2025

Which issue does this PR close?

What changes are included in this PR?

UNION [ALL | DISTINCT] BY NAME implementation and associated tests

Are these changes tested?

Yes

Are there any user-facing changes?

Yes, no breaking changes, but new functionality.

@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) labels Feb 7, 2025
NULL 3
5 NULL

# TODO: This should pass, but the sanity checker isn't allowing it.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few of the UNION ALL BY NAME tests are failing during the sanity checker. Not completely sure why atm 🤔

@@ -0,0 +1,264 @@
# Licensed to the Apache Software Foundation (ASF) under one
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most tests here were taken from DuckDB's SLT suite!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DuckDB to the best of my knowledge is NOT Apache licensed.. Any code or tests taken from them should be licensed appropriately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching that @Omega359. Can I include the notice there in conjunction with this header?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is anything to be done about this, let's do it before the merge

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having both should be ok @rkrishn7

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done @Omega359

@rkrishn7 rkrishn7 marked this pull request as ready for review February 10, 2025 05:35
@alamb
Copy link
Contributor

alamb commented Feb 10, 2025

FYI @berkaysynnada and @berkaysynnada

@Omega359
Copy link
Contributor

I ran the sqlite sqllogictests against your branch and it passed so none of those files covered union (all) by name

@berkaysynnada
Copy link
Contributor

I'll take a look ASAP, but any additional reviewers are welcomed

Copy link
Contributor

@berkaysynnada berkaysynnada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rkrishn7, I really like this PR. I'm just curios about why the SanityChecker does not allow those queries. I guess it should be related with equivalence reset during UnionExec's (perhaps we should sustain some info under some conditions). However, it's not a problem coming along with this PR, and I think it shouldn't be a blocker.

@berkaysynnada
Copy link
Contributor

I ran the sqlite sqllogictests against your branch and it passed so none of those files covered union (all) by name

sorry @Omega359, I couldn't quite get what you mean. Do we expect a failure?

@rkrishn7
Copy link
Contributor Author

rkrishn7 commented Feb 16, 2025

Thank you @rkrishn7, I really like this PR. I'm just curios about why the SanityChecker does not allow those queries. I guess it should be related with equivalence reset during UnionExec's (perhaps we should sustain some info under some conditions). However, it's not a problem coming along with this PR, and I think it shouldn't be a blocker.

Thanks for the review @berkaysynnada!

I was thinking I can open up an issue to fix the failing tests due to the sanity checker, and leave that as a follow-up once this is merged. Let me know if that sounds good to you.

@Omega359
Copy link
Contributor

I ran the sqlite sqllogictests against your branch and it passed so none of those files covered union (all) by name

sorry @Omega359, I couldn't quite get what you mean. Do we expect a failure?

No, it just means that this union isn't covered at all with sqlite tests.

@berkaysynnada
Copy link
Contributor

I was thinking I can open up an issue to fix the failing tests due to the sanity checker, and leave that as a follow-up once this is merged. Let me know if that sounds good to you.

Sounds great, let's do that

@berkaysynnada berkaysynnada merged commit be48714 into apache:main Feb 17, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions sql SQL Planner sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement UNION ALL BY NAME
4 participants