Skip to content

Commit

Permalink
feat(flink): flink sql 转换
Browse files Browse the repository at this point in the history
  • Loading branch information
collabH committed Jun 19, 2021
1 parent eb4f041 commit d4cedba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bigdata/flink/core/TableSQLOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,19 @@ table.executeInsert()
## Blink Planner架构

* Blink Planner将批 SQL 处理作为流 SQL 处理的特例,尽量对通用的处理和优化逻辑进行抽象和复用,通过 Flink 内部的 Stream Transformation API 实现流 & 批的统一处理,替代原 Flink Planner 将流 & 批区分处理的方式。
* 从SQL语句到Operation,再转换为Transformation,最后转换为Execution执行。

![](../img/BlinkPlanner架构.jpg)

### 从SQL到Operation

* Blink ParserImpl#parse将SQL语句生成为Operation树,生成新的Table对象。
* 1) 解析SQL字符串转换为QueryOperation。2) SQL字符串解析为SqlNode。3)校验SqlNode。4)调用Calcite SQLToRelConverter将SqlNode转换为RelNode逻辑树。5)RelNode转换为Operation。

### Operation到Transformation



## Flink SQL工作流

![](../img/FlinkSQL工作流.jpeg)
Expand Down

0 comments on commit d4cedba

Please sign in to comment.