apache-flink - 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 INSERT
s, some are CREATE
s. I also do some sqlQuery
s.
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.
解决方案
StreamTableEnvironment
没关系,您可以在with中查询表,StreamTableEnvironment.listTables()
然后执行StreamTableEnvironment.from(tableName).getSchema()
推荐阅读
- r - 错误消息:“”的包或命名空间加载失败
- flutter - 使用flutter_bloc时清除文本字段
- c# - 更改 nuget 包文件夹并在 Visual Studio 中使用另一个 NuGet.Config
- git - 如何将 Git/ssh 协议路由到“容器化”git 服务器
- sql-server - 如何将 XML 文件中的 Excel 序列号转换为 SSIS 包中 SQL Server 的 mm/dd/yyyy?
- python - 在如何为用户解决我的问题时遇到问题
- c++ - 避免两个 ROS 订阅者回调函数之间的数据竞争条件
- c# - C# 正则表达式优化
- node.js - 如何在 nodejs 中仅加密整个文件的一部分(例如:仅前 2500 个字节)?
- wordpress - 使用 wp_nav_menu_objects 将某些内容附加到 wordpress 导航菜单