如何把多个FLINK SQL放到同一个Yarn JOB里
// 运行多条 INSERT 语句,将原表数据输出到多个结果表中
StatementSet stmtSet = tEnv.createStatementSet();
// `addInsertSql` 方法每次只接收单条 INSERT 语句
stmtSet.addInsertSql(
'INSERT INTO RubberOrders SELECT product, amount FROM Orders WHERE product LIKE '%Rubber%'');
stmtSet.addInsertSql(
'INSERT INTO GlassOrders SELECT product, amount FROM Orders WHERE product LIKE '%Glass%'');
// 执行刚刚添加的所有 INSERT 语句
TableResult tableResult2 = stmtSet.execute();
// 通过 TableResult 来获取作业状态
System.out.println(tableResult1.getJobClient().get().getJobStatus());
赞0
踩0