- Mastering Apache Spark 2.x(Second Edition)
- Romeo Kienzler
- 302字
- 2021-07-02 18:55:33
Internal class and object representations of LEPs
As an unresolved plan is basically the first tree created from either SQL statements or the relational API of DataFrames and Datasets, it is mainly composed of sub-types of the LeafExpression objects, which are bound together by the Expression objects, therefore forming a tree of the TreeNode objects since all these objects are sub-types of TreeNode. Overall, this data structure is a LogicalPlan, which is therefore reflected as a LogicalPlan object. Note that LogicalPlan extends QueryPlan, and QueryPlan itself is TreeNode again. In other words, LogicalPlan is nothing else than a set of TreeNode objects.
The following two figures illustrate the inheritance tree of the different objects discussed:

As can be seen clearly in the previous figure, LeafExpression is the parent of most of the functional operators. Let's take Star for example. Star, a child class of LeafExpression, is parent to ResolvedStar and UnresolvedStar.
Since star in an SQL expression denotes all columns of a particular relation, Catalyst has to query the catalog in order to determine the names and types of columns referred to. So once the tree gets transformed from unresolved to resolved, also those classes are replaced. All these classes are inherited from TreeNode and are used to form abstract syntax trees. The same holds true not only for abstract syntax trees, but also for execution plans, as QueryPlan also inherits from TreeNode:

- JavaScript全程指南
- 趣學(xué)Python算法100例
- Mastering OpenCV 4
- 深入理解Java7:核心技術(shù)與最佳實(shí)踐
- JavaScript從入門到精通(第3版)
- 深入淺出DPDK
- Android開發(fā)案例教程與項(xiàng)目實(shí)戰(zhàn)(在線實(shí)驗(yàn)+在線自測)
- Geospatial Development By Example with Python
- Learning Node.js for .NET Developers
- Instant Automapper
- JavaEE架構(gòu)與程序設(shè)計(jì)
- Clojure Data Structures and Algorithms Cookbook
- 程序員的英語
- Docker on Windows
- MATLAB計(jì)算機(jī)視覺實(shí)戰(zhàn)