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

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

GitHub user patricker opened a pull request:

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

    NIFI-2591 - PutSQL has no handling for Binary data types

    PutSQL has no handling for Binary data types.
    The only path into PutSQL is for your binary data to be serialized as a 
string in an attribute.  Currently if you follow the Avro->JSON->SQL path Avro 
will encode the binary data as 1 byte characters (ASCII). JSON to SQL takes 
these strings and tries to insert them as Objects, since there was no case for 
any of the binary types.
    
    I added in handling for all three binary types and included a Derby test 
case.

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

    $ git pull https://github.com/patricker/nifi NIFI-2591

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

    https://github.com/apache/nifi/pull/883.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 #883
    
----
commit 77c5c23b65b59aacaade9dac38e8c69196c40c9b
Author: Peter Wicks <[email protected]>
Date:   2016-08-17T15:06:09Z

    PutSQLBinary

commit c2c2cc7da95eb5b69dcfeda4b79a6ccadfd1b917
Author: Peter Wicks <[email protected]>
Date:   2016-08-17T18:22:32Z

    NIFI-2591

----


> PutSQL has no handling for Binary data types
> --------------------------------------------
>
>                 Key: NIFI-2591
>                 URL: https://issues.apache.org/jira/browse/NIFI-2591
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Peter Wicks
>
> PutSQL does not call out binary types for any special treatment, so they end 
> up being routed through stmt.setObject.
> The problem is that upstream processors have formatted the binary data as a 
> string and the JDBC driver doesn't know what to do with a string going into a 
> binary field.
> Investigation into the AvroToJSON processor shows that if users are trying to 
> load data exported from a source system as Avro Binary that Avro encodes the 
> binary data into ASCII (One byte per character).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to