apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhupesh Chawda <bhup...@datatorrent.com>
Subject Re: Changes to JdbcOutputOperator
Date Fri, 11 Dec 2015 10:50:13 GMT
Hi All,

We are planning to proceed with the following approach for JDBC *update*
operator:

   - *Update Query Configuration*


   - Example Update Query: *update tableName set a = ?** where b = ? and c
   > ?;*
   - Example JSON input array for parameter instantiations: *[{a,
   expression, INTEGER}, {b, expression, VARCHAR}, {c, expression, DATE}]*

We are also planning to change the JDBC Output Operator in Malhar Library
which currently does just insert. We plan to make the input format
consistent for both insert and update and hence the change to the current
way of configuration using JSON. Following would be the config for inserts:

   - *Insert Query Configuration*


   - Example Insert Query: *insert into tableName values (?, ?, .. , ?);*
   - Example JSON input array for parameter instantiations: *[{a,
   expression, INTEGER}, {b, expression, VARCHAR}, .. , {c, expression, DATE}]*

Please let us know your thoughts.

Thanks.

-Bhupesh



On Wed, Dec 9, 2015 at 6:38 PM, Bhupesh Chawda <bhupesh@datatorrent.com>
wrote:

> Hi All,
>
> Would it be a good idea to introduce the update functionality to the JDBC
> output operator in Apache Apex Malhar library.
>
> The following are possible approaches:
>
>    1. Accept a update query from the user with place holders for values.
>    Example: *update tableName set a = ?, b = ? where c = ? and d > ?*.
>    Here "?" will be provided by the user as java expressions which will be
>    evaluated from the incoming tuple.
>    2. Another option is to accept in some configuration format (json /
>    xml) the following and formulate the query in the operator. This can become
>    arbitrarily complex.
>    1. update clause columns
>       2. update clause expressions
>       3. where clause columns
>       4. where clause expressions
>
> I am thinking about going ahead with 1. Please let me know if any other
> option is possible and whether such a functionality already exists in some
> other class.
>
> Thanks.
>
> -Bhupesh
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message