BenoitParis
BenoitParis

Reputation: 3184

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.

Upvotes: 1

Views: 141

Answers (1)

BenoitParis
BenoitParis

Reputation: 3184

Nevermind, you can query tables in the StreamTableEnvironment with StreamTableEnvironment.listTables() and then do a StreamTableEnvironment.from(tableName).getSchema()

Upvotes: 2

Related Questions