3 ms·
The pipeline syntax as presented is nicer than the status quo, but I'd prefer a syntax that models query execution as a directed graph of operations. Doing so w
by 10000truths 2y ago
The pipeline syntax as presented is nicer than the status quo, but I'd prefer a syntax that models query execution as a directed graph of operations. Doing so would not only make some of the more complex SQL query constructs much more straightforward to represent:
* Joins can be modelled as a "cross-referencing" operation that consume two (or more) data streams and produce a single data stream
* CTEs can be modelled as producing multiple data streams
* Recursive CTEs can be modelled as cycles in the execution graph
- almostgotcaught 2y ago> a directed graph of operations What syntax do you know that can represent a dag in text?
- RyanHamilton 2y agoA = select * from tbla B = select * from tblb C = select * from A join B
- wtetzner 2y agoI guess CTEs already provide that (even if they're a bit clunky). WITH a AS (select * from tbla), b AS (select * from tblb) select * from a join b
- almostgotcaught 2y agoYes we already have that, it's called `async def`.
- cha42 2y agoAny syntax with a let operator to name stuff or a lambda abstraction.
- almostgotcaught 2y agoThat only gives you trees not DAGs - you can't do fan-in (there's no way to "share" let bound names).
- mathnmusic 2y agoIsn't this fan-in? let A = select * from tbla let B = select * from tblb let C = select * from A join B
- almostgotcaught 2y agoThink about what tbla and tblb can be - hint they can only be globals (ie actual tables)
- mr_toad 2y agoSomething like the DOT language used in GraphViz https://graphviz.org/doc/info/lang.html https://graphviz.org/doc/info/lang.html
- almostgotcaught 2y agoYes DOT (and the other UML whatever languages) are absolutely the only extant examples that make an attempt. But again, if you look at DOT you'll see it doesn't actually do anything syntactically - it just has syntax for edge lists.
- aranke 2y agoCheck out Substrait, it sounds like what you’re describing.