首页 > 解决方案 > List all Sources and Sinks in a Flink SQL job

问题描述

I'm building a sort of wrapper around Flink SQL. I construct a job with a bunch of user-specified SQL statements with StreamTableEnvironment.sqlUpdate. Some are INSERTs, some are CREATEs. I also do some sqlQuerys.

Before I'm calling StreamExecutionEnvironment.execute, I'd like to list all Sources and Sinks that the user created.

Is there a simple / official way to do it, or do I need to go exploring with StreamExecutionEnvironment.getStreamGraph().getJobGraph().getVerticesSortedTopologicallyFromSources()?

Best regards

EDIT: I need the table names, and associated schemas.

标签: apache-flinkflink-streamingflink-sqlflink-table-api

解决方案


StreamTableEnvironment没关系,您可以在with中查询表,StreamTableEnvironment.listTables()然后执行StreamTableEnvironment.from(tableName).getSchema()


推荐阅读