Skip to content

Commit 49d7413

Browse files
authored
Merge pull request #1 from DTStack/1.8_release
merge
2 parents a0fb9b3 + f54450c commit 49d7413

File tree

4 files changed

+44
-42
lines changed

4 files changed

+44
-42
lines changed

README.md

+13-31
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
1-
# flinkStreamSQL
1+
2+
## 技术交流
3+
* 招聘大数据平台开发工程师,想了解岗位详细信息可以添加本人微信号ysqwhiletrue,注明招聘,如有意者发送简历至[email protected]
4+
5+
* 可以搜索群号30537511或者可以扫下面的二维码进入钉钉群
6+
<div align=center>
7+
<img src=https://github.com/DTStack/flinkStreamSQL/blob/1.8_release/images/IMG_1573.JPG width=300 />
8+
</div>
9+
10+
11+
## flinkStreamSQL
212
> * 基于开源的flink,对其实时sql进行扩展
313
> > * 自定义create table 语法(包括源表,输出表,维表)
414
> > * 自定义create view 语法
515
> > * 自定义create function 语法
616
> > * 实现了流与维表的join
717
> > * 支持原生FLinkSQL所有的语法
818
> > * 扩展了输入和输出的性能指标到promethus
9-
10-
## 新特性:
11-
* 1.kafka源表支持not null语法,支持字符串类型的时间转换。
12-
* 2.rdb维表与DB建立连接时,周期进行连接,防止连接断开。rdbsink写入时,对连接进行检查。
13-
* 3.异步维表支持非等值连接,比如:<>,<,>。
14-
* 4.增加kafka数组解析
15-
* 5.增加kafka1.0以上版本的支持
16-
* 6.增加postgresql、kudu、clickhouse维表、结果表的支持
17-
* 7.支持插件的依赖方式,参考pluginLoadMode参数
18-
* 8.支持cep处理
19-
* 9.支持udaf
20-
* 10.支持谓词下移
21-
* 11.支持状态的ttl
22-
23-
## BUG修复:
24-
* 1.修复不能解析sql中orderby,union语法。
25-
* 2.修复yarnPer模式提交失败的异常。
26-
* 3.一些bug的修复
2719
28-
# 已支持
20+
## 已支持
2921
* 源表:kafka 0.9、0.10、0.11、1.x版本
3022
* 维表:mysql, SQlServer,oracle, hbase, mongo, redis, cassandra, serversocket, kudu, postgresql, clickhouse, impala, db2, sqlserver
3123
* 结果表:mysql, SQlServer, oracle, hbase, elasticsearch5.x, mongo, redis, cassandra, console, kudu, postgresql, clickhouse, impala, db2, sqlserver
3224

33-
# 后续开发计划
34-
* 维表快照
35-
* kafka avro格式
36-
* topN
3725

3826
## 1 快速起步
3927
### 1.1 运行模式
@@ -323,11 +311,5 @@ into
323311
and a.pv=10 ) as d
324312
```
325313

326-
# 招聘
327-
1.大数据平台开发工程师,想了解岗位详细信息可以添加本人微信号ysqwhiletrue,注明招聘,如有意者发送简历至[email protected]
328-
329-
# FlinkX & FlinkStreamSQL钉钉交流群
314+
330315

331-
<div align=center>
332-
<img src=https://user-images.githubusercontent.com/11881814/76816457-3df44800-683b-11ea-94cc-707fb0250a9a.png width=600 />
333-
</div>

core/src/main/java/com/dtstack/flink/sql/exec/ExecuteProcessHelper.java

+31-11
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@
8080
import java.util.Set;
8181

8282
/**
83-
* 任务执行时的流程方法
83+
* 任务执行时的流程方法
8484
* Date: 2020/2/17
8585
* Company: www.dtstack.com
86+
*
8687
* @author maqi
8788
*/
8889
public class ExecuteProcessHelper {
@@ -131,7 +132,8 @@ public static ParamsInfo parseParams(String[] args) throws Exception {
131132
}
132133

133134
/**
134-
* 非local模式或者shipfile部署模式,remoteSqlPluginPath必填
135+
* 非local模式或者shipfile部署模式,remoteSqlPluginPath必填
136+
*
135137
* @param remoteSqlPluginPath
136138
* @param deployMode
137139
* @param pluginLoadMode
@@ -189,12 +191,12 @@ private static List<URL> getExternalJarUrls(String addJarListStr) throws java.io
189191
}
190192

191193
private static void sqlTranslation(String localSqlPluginPath,
192-
StreamTableEnvironment tableEnv,
193-
SqlTree sqlTree,Map<String, SideTableInfo> sideTableMap,
194-
Map<String, Table> registerTableCache,
195-
StreamQueryConfig queryConfig) throws Exception {
194+
StreamTableEnvironment tableEnv,
195+
SqlTree sqlTree, Map<String, SideTableInfo> sideTableMap,
196+
Map<String, Table> registerTableCache,
197+
StreamQueryConfig queryConfig) throws Exception {
196198

197-
SideSqlExec sideSqlExec = new SideSqlExec();
199+
SideSqlExec sideSqlExec = new SideSqlExec();
198200
sideSqlExec.setLocalSqlPluginPath(localSqlPluginPath);
199201
for (CreateTmpTableParser.SqlParserResult result : sqlTree.getTmpSqlList()) {
200202
sideSqlExec.exec(result.getExecSql(), sideTableMap, tableEnv, registerTableCache, queryConfig, result);
@@ -254,13 +256,14 @@ private static void registerUserDefinedFunction(SqlTree sqlTree, List<URL> jarUr
254256
}
255257

256258
/**
257-
* 向Flink注册源表和结果表,返回执行时插件包的全路径
259+
* 向Flink注册源表和结果表,返回执行时插件包的全路径
260+
*
258261
* @param sqlTree
259262
* @param env
260263
* @param tableEnv
261264
* @param localSqlPluginPath
262265
* @param remoteSqlPluginPath
263-
* @param pluginLoadMode 插件加载模式 classpath or shipfile
266+
* @param pluginLoadMode 插件加载模式 classpath or shipfile
264267
* @param sideTableMap
265268
* @param registerTableCache
266269
* @return
@@ -293,7 +296,23 @@ private static Set<URL> registerTable(SqlTree sqlTree, StreamExecutionEnvironmen
293296

294297
if (waterMarkerAssigner.checkNeedAssignWaterMarker(sourceTableInfo)) {
295298
adaptStream = waterMarkerAssigner.assignWaterMarker(adaptStream, typeInfo, sourceTableInfo);
296-
fields += ",ROWTIME.ROWTIME";
299+
String eventTimeField = sourceTableInfo.getEventTimeField();
300+
boolean hasEventTimeField = false;
301+
if (!Strings.isNullOrEmpty(eventTimeField)) {
302+
String[] fieldArray = fields.split(",");
303+
for (int i = 0; i < fieldArray.length; i++) {
304+
if (fieldArray[i].equals(eventTimeField)) {
305+
fieldArray[i] = eventTimeField + ".ROWTIME";
306+
hasEventTimeField = true;
307+
break;
308+
}
309+
}
310+
if (hasEventTimeField) {
311+
fields = String.join(",", fieldArray);
312+
} else {
313+
fields += ",ROWTIME.ROWTIME";
314+
}
315+
}
297316
} else {
298317
fields += ",PROCTIME.PROCTIME";
299318
}
@@ -329,7 +348,8 @@ private static Set<URL> registerTable(SqlTree sqlTree, StreamExecutionEnvironmen
329348
}
330349

331350
/**
332-
* perjob模式将job依赖的插件包路径存储到cacheFile,在外围将插件包路径传递给jobgraph
351+
* perjob模式将job依赖的插件包路径存储到cacheFile,在外围将插件包路径传递给jobgraph
352+
*
333353
* @param env
334354
* @param classPathSet
335355
*/

images/IMG_1573.JPG

195 KB
Loading

images/钉钉群.jpg

-89.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)