Bryan Bende created NIFI-1328:
---------------------------------

             Summary: PutSQL Error Inserting an integer to a Phoenix table
                 Key: NIFI-1328
                 URL: https://issues.apache.org/jira/browse/NIFI-1328
             Project: Apache NiFi
          Issue Type: Bug
    Affects Versions: 0.4.1, 0.4.0
            Reporter: Bryan Bende
            Assignee: Bryan Bende
            Priority: Critical
             Fix For: 0.5.0


In 0.4.0 we condensed a big case statement in PutSQL down to this (around line 
728):
{code}
stmt.setObject(parameterIndex, parameterValue, jdbcType);
{code}

If we send a String as parameterValue, with a jdbcType of 4 which is “int”, 
this Phoenix method which doesn’t like that:
https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixPreparedStatement.java#L439

Before we had:
{code}
case Types.INTEGER:
                    stmt.setInt(parameterIndex, 
Integer.parseInt(parameterValue));
                    break;
{code}

So it worked because Phoenix didn’t have to do any conversion. We need to 
consider going back to explicitly converting the string like we were doing 
before.



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

Reply via email to