开发者社区> 问答> 正文

通过表环境执行insert into语句提交作业,我该如何设置我的job名称呢?

我通过表环境执行insert into语句提交作业,我该如何设置我的job名称呢?

程序: EnvironmentSettings bbSettings = EnvironmentSettings.newInstance().useBlinkPlanner().build(); TableEnvironment bsTableEnv = TableEnvironment.create(bbSettings);

String sourceDDL = "CREATE TABLE datagen ( " + " f_random INT, " + " f_random_str STRING, " + " ts AS localtimestamp, " + " WATERMARK FOR ts AS ts " + ") WITH ( " + " 'connector' = 'datagen', " + " 'rows-per-second'='10', " + " 'fields.f_random.min'='1', " + " 'fields.f_random.max'='5', " + " 'fields.f_random_str.length'='10' " + ")";

bsTableEnv.executeSql(sourceDDL); Table datagen = bsTableEnv.from("datagen");

System.out.println(datagen.getSchema());

String sinkDDL = "CREATE TABLE print_table (" + " f_random int," + " c_val bigint, " + " wStart TIMESTAMP(3) " + ") WITH ('connector' = 'print') "; bsTableEnv.executeSql(sinkDDL);

System.out.println(bsTableEnv.from("print_table").getSchema());

Table table = bsTableEnv.sqlQuery("select f_random, count(f_random_str), TUMBLE_START(ts, INTERVAL '5' second) as wStart from datagen group by TUMBLE(ts, INTERVAL '5' second), f_random"); bsTableEnv.executeSql("insert into print_table select * from " + table);

*来自志愿者整理的flink邮件归档

展开
收起
游客sadna6pkvqnz6 2021-12-07 17:09:47 583 0
1 条回答
写回答
取消 提交回答
  • YI: 有一个issue[1] 正在跟进和解决这个问题

    [1] https://issues.apache.org/jira/browse/FLINK-18545*来自志愿者整理的flink

    2021-12-07 20:31:34
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
MaxCompute Logview参数详解和问题排查(废弃) 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载