作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以下代码片段取自此 blog post :
val sensorTable = ??? // can be a CSV file, Kafka topic, database, or ...
// register the table source
tEnv.registerTableSource("sensors", sensorTable)
我想从关系数据库中读取数据。 Flink 有用于 JDBC 数据库的 TableSource
吗?
最佳答案
在当前版本(1.4.0,2017 年 12 月)中,Flink 不提供内置的 TableSource
来从关系数据库中提取数据。
但是,有一个JDBCInputFormat
可以使用。您可以
DataSet
as a Table
从数据库读取数据或JdbcTableSource
包装JdbcInputFormat
。 JdbcTableSource
的简单实现应该很容易实现。实现对并行读取、投影或过滤器下推的支持需要付出更多努力。关于apache-flink - Apache 弗林克 : How to query a relational database with the Table API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47811022/
我是一名优秀的程序员,十分优秀!