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

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

Github user patricker commented on the issue:

    https://github.com/apache/nifi/pull/883
  
    You absolutely could put your Smilies in to a binary field, but _before_ 
you send them to PutSQL you need to convert them to Binary using something like 
string.getBytes("UTF-8").  At that point they become plain bytes and they 
should load without issue.
    
    To get the flow file into Binary I would use the Base64EncodeContent 
processor first, then use RelaceText to move it to an attribute, and finally 
push it using PutSQL with the 'base64' option.


> 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