Closed mei-rune closed 4 years ago
The crux is keep: true and keep: false.
The first one creates any new expressions (in a map for example) keeping the old ones. This way a filter node has access to all the fields. New ones and old ones. (you can do SELECT p.age + 5 as newage FROM people p WHERE newage > p.age).
Then you have a second map node, which will only leave the necessary fields. (the ones the user selected).
Indeed, in your case the first one is unnecessary, but that could be added to the optimizer as a new optimization rule in the future and is not really that important imo.
Thinks
I write a graphviz tool for octosql https://github.com/cube2222/octosql/issues/203
And I try convert "select a, b, c from abc as xxx" to a image file.
why two map object in the logical nodes?