You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by "Mark Payne (JIRA)" <ji...@apache.org> on 2015/10/14 18:20:05 UTC

[jira] [Updated] (NIFI-977) PutSQL - attribute type cannot be negative

     [ https://issues.apache.org/jira/browse/NIFI-977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Payne updated NIFI-977:
----------------------------
    Priority: Major  (was: Minor)

> PutSQL - attribute type cannot be negative
> ------------------------------------------
>
>                 Key: NIFI-977
>                 URL: https://issues.apache.org/jira/browse/NIFI-977
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.3.0
>            Reporter: Daryl Teo
>             Fix For: 0.4.0
>
>
> - PutSQL expects JDBC Types numeric values.
> - FlowFile attributes are String based.
> - Some JDBC Types have negative numeric values.
> For example - BIGINT is -5
> http://docs.oracle.com/javase/7/docs/api/constant-values.html#java.sql.Types.BIGINT
> - NUMBER_PATTERN only looks for digits. 
> https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSQL.java#L147
> Reproduce
> - Use a UpdateAttribute + ReplaceText processors to prepare a SQL statement
> - Set sql.args.1.type to -5
> - Set sql.args.1.value to '123'
> - Set text to some sql statement.
> - Pipe success relationship into PutSQL
> Effect 
> - error log : sql.args.1.type is not a valid jdbc numeral value
> Workarounds
> - Use supported types with positive numbers. May lead to loss of precision (setInt vs setLong).
> Proposed fix
> - change NUMBER_PATTERN from {noformat}\\d+{noformat} to {noformat}-?\\d+{noformat}



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