beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rik Nauta (JIRA)" <>
Subject [jira] [Commented] (BEAM-2376) JdbcIO should allow multiple statements
Date Thu, 29 Jun 2017 13:46:00 GMT


Rik Nauta commented on BEAM-2376:

Awesome! I've actually opened another issue to also make the batchSize configurable...might
be easy to do in the same swoop?

> JdbcIO should allow multiple statements
> ---------------------------------------
>                 Key: BEAM-2376
>                 URL:
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-extensions
>    Affects Versions: Not applicable
>            Reporter: Rik Nauta
>            Assignee: Jean-Baptiste Onofré
>             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

View raw message