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

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.

An easy way to explore Java and Scala inheritance trees in Eclipse is by opening any particular class or interface using the Open Type function ( Navigate | Open Type...) and then just type in the desired name, for example LeafExpression. Once the type is opened, the Open Type Hierarchy ( Navigate | Open Type Hierarchy...) function can be used to generate those diagrams, as can be seen in previous figures.

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:

主站蜘蛛池模板: 南宁市| 青龙| 桑植县| 鄂尔多斯市| 榕江县| 新源县| 秀山| 恭城| 西林县| 沐川县| 湘潭市| 婺源县| 长海县| 尼勒克县| 高淳县| 扎兰屯市| 淳安县| 克拉玛依市| 哈密市| 华容县| 吴江市| 桃园县| 绥江县| 英德市| 静宁县| 阳新县| 博湖县| 莱西市| 安塞县| 蛟河市| 宜丰县| 巴南区| 宁蒗| 安多县| 申扎县| 伊宁市| 彭水| 安平县| 东辽县| 普兰店市| 诸暨市|