prql icon indicating copy to clipboard operation
prql copied to clipboard

feat: Add union operator

Open max-sixty opened this issue 3 years ago • 2 comments

This is still a WIP -- I'm getting a error in semantic which I need to spend some more time on.

Any thoughts on the language design? Currently this has a required positional param to specify the type of the union -- should we do that vs. an optional named param?

max-sixty avatar Jul 30 '22 22:07 max-sixty

I like the language design: in most cases you'd write union all, which is quite self-explanatory. We could use a default value here, but we'd have to convert to a named argument:

from table1
union kind:distinct table2

Regarding the comment about resolving: to be honest I don't remember how to enable table resolving at main branch because I redid that at semantic branch 2 times :D Can this PR wait a week for semnatic to be merged?

aljazerzen avatar Aug 03 '22 15:08 aljazerzen

Can this PR wait a week for semantic to be merged?

For sure!

max-sixty avatar Aug 03 '22 15:08 max-sixty

I've tried to convert this to a "good-first-issue", but it included work on many parts of the codebase, so I just did it myself.

It needs docs, though.

This is how it works:

from employees
concat managers
union other_employees

aljazerzen avatar Dec 15 '22 18:12 aljazerzen

Awesome!! I am happy to do the docs

max-sixty avatar Dec 15 '22 22:12 max-sixty