- Mastering Apache Spark 2.x(Second Edition)
- Romeo Kienzler
- 217字
- 2021-07-02 18:55:32
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.
- Bootstrap Essentials
- MySQL數據庫管理與開發(慕課版)
- ADI DSP應用技術集錦
- ANSYS Fluent 二次開發指南
- PLC應用技術(三菱FX2N系列)
- 區塊鏈技術與應用
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- JavaScript應用開發實踐指南
- Hands-On Full Stack Development with Spring Boot 2.0 and React
- 零基礎學Python編程(少兒趣味版)
- Emotional Intelligence for IT Professionals
- Instant Zurb Foundation 4
- Flask Web開發:基于Python的Web應用開發實戰(第2版)
- Appcelerator Titanium:Patterns and Best Practices
- SQL Server on Linux