- 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.
- Spring 5.0 Microservices(Second Edition)
- 算法精粹:經(jīng)典計算機科學(xué)問題的Java實現(xiàn)
- 跟老齊學(xué)Python:輕松入門
- Python貝葉斯分析(第2版)
- Hands-On Enterprise Automation with Python.
- Python:Master the Art of Design Patterns
- 快速入門與進階:Creo 4·0全實例精講
- CRYENGINE Game Development Blueprints
- Building Serverless Architectures
- 機器學(xué)習(xí)微積分一本通(Python版)
- 嵌入式Linux C語言程序設(shè)計基礎(chǔ)教程
- Hack與HHVM權(quán)威指南
- R語言實戰(zhàn)(第2版)
- PHP 7 Programming Blueprints
- Python Django Web從入門到項目實戰(zhàn)(視頻版)