使用 Apache Beam 覆盖 JdbcIO 中生成的插入语句 [英] Override generated insert statement in JdbcIO with Apache Beam

查看:32
本文介绍了使用 Apache Beam 覆盖 JdbcIO 中生成的插入语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Postgres 中写入列类型设置为 json 的记录.在 JdbcIO 的 Python 版本中,WriteToJdbc 有一个语句"假设覆盖生成的插入语句的参数.好像根本没用

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))'
            )

我在这里遗漏了什么吗?

Am I missing something here ?

推荐答案

JdbcIO 的 Python 版本仍处于实验阶段,并未得到完全支持.此功能有一个开放的 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 中生成的插入语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆