本文介绍了使用Apache Beam覆盖JdbcIO中生成的插入语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Postgres中写记录,列类型设置为json.在Python版本的JdbcIO中,WriteToJdbc具有"statement".假定该参数将覆盖生成的insert语句.看来根本没有用
I wanted to write records in Postgres with a column type set as json. In Python version of JdbcIO, WriteToJdbc has a "statement" parameter which is suppose to override the generated insert statement. It seems that it is not working at all
| 'Write to jdbc' >> WriteToJdbc(
table_name="teacher",
driver_class_name='org.postgresql.Driver',
jdbc_url='jdbc:{}://{}:{}/{}'.format("postgresql", "your ip address", "5432", "postgres"),
username="postgres",
password="password"
statement = 'insert into researcher(id, first_name, last_name, total, payload) values (?, ?, ?, ?, cast(? as json))'
)
我在这里想念东西吗?
推荐答案
Python版本的JdbcIO仍处于试验阶段,不完全受支持.有一个开放的Beam JIRA票证可用于此功能: https://issues.apache.org/jira/browse/BEAM-10750
The Python version of JdbcIO is still experimental and not fully supported. There's an open Beam JIRA ticket for this feature: https://issues.apache.org/jira/browse/BEAM-10750
这篇关于使用Apache Beam覆盖JdbcIO中生成的插入语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!