|
|
|
|
|
by tmoertel
831 days ago
|
|
The point of SQL pipe syntax is that there is no reordering. You read the query as a sequence of operations, and that's exactly how it's executed. (Semantically. Of course, the query engine is free to optimize the execution plan as long as the semantics are preserved.) The pipe operator is a semantic execution barrier:everything before the `|>` is assumed to have executed and returned a table before what follows begins: From the paper: > Each pipe operator is a unary relational operation that takes one table as input and produces one table as output. Vanilla SQL is actually more complex in this respect because you have, for example, at least 3 different keywords for filtering (WHERE, HAVING, QUALIFY) and everyone who reads your query needs to understand what each keyword implies regarding execution scheduling. (WHERE is before grouping, HAVING is after aggregates, and QUALIFY is after analytic window functions.) |
|