You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2020/09/02 17:08:38 UTC

[jira] [Commented] (BEAM-2376) JdbcIO should allow multiple statements

    [ https://issues.apache.org/jira/browse/BEAM-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17189489#comment-17189489 ] 

Beam JIRA Bot commented on BEAM-2376:
-------------------------------------

This issue was marked "stale-P2" and has not received a public comment in 14 days. It is now automatically moved to P3. If you are still affected by it, you can comment and move it back to P2.

> JdbcIO should allow multiple statements
> ---------------------------------------
>
>                 Key: BEAM-2376
>                 URL: https://issues.apache.org/jira/browse/BEAM-2376
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-jdbc
>    Affects Versions: Not applicable
>            Reporter: Rik Nauta
>            Priority: P3
>             Fix For: Not applicable
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Right now the JdbcIO pipeline adds a single Write statement to the batch per PCollection element. This makes it difficult to execute several statements that require a specific order (for instance due to constraints in the DB), since JDBC doesn't allow multiple statements in a single "addBatch". 
> For instance, I can't execute {{INSERT INTO users (id) VALUES (test); INSERT INTO profiles (user_id, name) VALUES (test, 'John');}}
> There's several ways we could solve this, one would be not to return a PDone but just pass through the data so that you can at least chain several Writes.
> Alternatively we could take the Statement string, split on the ";" character if there is one and apply each statement to the either an array of argument setters or the same setter with an additional {{statement_#}} parameter. And then we simply don't commit a batch between these statements.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)