官术网_书友最值得收藏!

The SQL abstract syntax tree

As explained earlier, it doesn't matter if you are using SQL, DataFrame, or Dataset, the Apache Spark SQL parser returns an abstract syntax tree. However, DataFrames or Datasets can be used as starting points. The result of all these methods is again a tree-based structure called ULEP. The following figure is an example of such an AST (abstract syntax tree) adding an attribute coming from a row in a table and two literals together:

So as you can see, at the bottom of the tree (those nodes are also called leaves since they don't have any further nodes connecting to them) we have two integer literals: one and two. On top we have an operation taking those two literals and adding them together. You should note that those literals could also be loaded from a persistent data store. The Add operation virtually turns into another literal (three in this case), which then again is used by another Add operation as one of its inputs. The other input labeled as Attribute(x) now takes the value of x of that particular relation and exposes it as materialized value to the Add operator. So in other words, this AST does nothing else than add the number three to each of the values in column x.

主站蜘蛛池模板: 正镶白旗| 铜鼓县| 石渠县| 乌海市| 蓬莱市| 龙川县| 乌兰县| 尚义县| 天祝| 平陆县| 合川市| 岐山县| 辰溪县| 渝北区| 改则县| 治县。| 安福县| 安多县| 永宁县| 桃源县| 松滋市| 延吉市| 屏边| 界首市| 洛阳市| 平武县| 磐安县| 双峰县| 小金县| 肥东县| 土默特右旗| 合阳县| 恩施市| 临颍县| 宣城市| 吴川市| 南安市| 习水县| 望城县| 宜君县| 永安市|