You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/17 20:33:41 UTC

[jira] [Commented] (NIFI-3704) Add PutDatabaseRecord processor

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

ASF GitHub Bot commented on NIFI-3704:
--------------------------------------

GitHub user mattyb149 opened a pull request:

    https://github.com/apache/nifi/pull/1677

    NIFI-3704: Add PutDatabaseRecord processor

    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [x] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [x] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [x] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mattyb149/nifi put-db-record

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1677.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1677
    
----
commit 102e83a516b161e980448ef3000c8c895768d9dd
Author: Matt Burgess <ma...@apache.org>
Date:   2017-04-17T20:30:59Z

    NIFI-3704: Add PutDatabaseRecord processor

----


> Add PutDatabaseRecord processor
> -------------------------------
>
>                 Key: NIFI-3704
>                 URL: https://issues.apache.org/jira/browse/NIFI-3704
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Extensions
>            Reporter: Matt Burgess
>            Assignee: Matt Burgess
>             Fix For: 1.2.0
>
>
> With the inclusion of NIFI-1280, which added Controller Services for RecordReaders and RecordWriters, we could now support a processor that reads records in, generates SQL statements for those records (with a specified verb such as INSERT, UPDATE, DELETE, etc.), and can execute all the records in one flow file as a batch. This would allow the processor to use a single PreparedStatement and, for a flow file containing multiple records, would be able to execute them all at once. This is in contrast to PutSQL which handles batches across flow files (if fragmented transactions are enabled) or with a discrete set (by taking at most a specified number of flow files at a time).
> This processor (called PutDatabaseRecord) would effectively act like the combination of ConvertJSONToSQL and PutSQL, with the added features of being able to take records in an arbitrary format (given that there is a RecordReader implementation for that format) such as Avro, JSON, CSV, etc. and execute all the statements for the flow file at once.
> Another improvement upon what can be done in ConvertJSONToSQL would be to support BEGIN, COMMIT, and SQL verbs. This could be accomplished by adding an AllowableValue to the dropdown, letting the user select "Use statement.type Attribute". If this was selected, then the verb would be expected to be in the value of the "statement.type" attribute of the incoming flow file.  Note that this may supercede or deprecate the need for NIFI-3676, unless this capability is also desired for that processor.
> For BEGIN and COMMIT verbs, the contents of the record(s) are not needed, as the type itself should be enough to generate the appropriate SQL commands. For the "SQL" Statement type, the processor could either expect the flow file to contain a SQL statement (so the RecordReader would not be used), or it could expect a field called "sql" that contains the SQL statement as its value.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)