cassandra - CassandraBeamIO 转换成 ROWS 的 Pcollection
问题描述
我正在尝试使用 apache beam CassandraIO 从 Cassandra db 读取数据,我的要求是从 cassandra db 创建 Pcollection of Rows,目前我的代码如下所示
PTransform<PBegin,PCollection<Row>>transform=CassandraIO.<Row>read()
.withHosts(Collections.singletonList("127.0.0.1"))
.withPort(9042)
.withKeyspace("\"testDb\"")
.withMapperFactoryFn(new CassandraRowMapper())
.withQuery(q)
.withTable("student")
.withEntity(Row.class)
.withCoder(SerializableCoder.of(Row.class));
任何帮助将不胜感激
解决方案
推荐阅读
- c - 字符串长度未正确显示
- assembly - 如何在 NASM 中为 x86 程序集上的 `ADD r/m16, imm16` 生成匹配 `81 /0 iw` 的输出?
- postgresql - 有没有办法将 csv 视为表来匹配键并将数据导入到 postgres 中的适当行?
- python - 如何创建服务或 shell 脚本以在 virtualenv 中运行项目?
- javascript - 暗模式/亮模式 - html,css
- mocha.js - 如何在 Mocha it 测试中定义一个通用函数?
- oracle - how to append values to a plsql table
- reactjs - React.forwardRef转发ref后如何定义Input组件ref的类型?
- python - 无法访问 docker 容器内的 https
- java - 程序参数中的文件夹路径缺少 sts4 中的最后一个“/”