THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!

Apache Kylin : Analytical Data Warehouse for Big Data

Page tree

Welcome to Kylin Wiki.



Background

Since that fact that Kylin4 is highly depend on Spark SQL, it better we have a deeper understanding of Spark SQL.

Definitation

Catalyst is an execution-agnostic framework to represent and manipulate a dataflow graph, i.e. trees of relational operators and expressions

The main abstraction in Catalyst is TreeNode that is then used to build trees of Expressions or QueryPlans.

Core Contract

NameRoleComment
SparkSession

DatasetStructured Query with Data Encoder

Dataset is a strongly-typed data structure in Spark SQL that represents a structured query.

CatalystTree Manipulation FrameworkCatalyst is an execution-agnostic framework to represent and manipulate a dataflow graph, i.e. trees of relational operators and expressions.
TreeNodeNode in Catalyst Tree

TreeNode is a recursive data structure that can have one or many children that are again TreeNodes.

ExpressionExecutable Node in Catalyst Tree

Expression is a executable node (in a Catalyst tree) that can evaluate a result value given input values, i.e. can produce a JVM object per InternalRow.

QueryPlanStructured Query Plan

QueryPlan is part of Catalyst to build a tree of relational operators of a structured query.

Scala-specific, QueryPlan is an abstract class that is the base class of LogicalPlan and SparkPlan (for logical and physical plans, respectively).

Core Diagram

Framework UML Diagram


«BASIC»TreeNode // TreeNode is a recursive data structure that can have one or many children that are again TreeNodes. children : Seq[BaseType] verboseString: String Expression // only required methods that have no implementation dataType: DataType nullable: Boolean doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode eval(input: InternalRow = EmptyRow): Any QueryPlan def output: Seq[Attribute]def validConstraints: Set[Expression]

Credit

All right reserved to jaceklaskowski. 


  • No labels