Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-1328

PutSQL Error Inserting an integer to a Phoenix table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.4.0, 0.4.1
    • 0.5.0
    • None
    • None

    Description

      In 0.4.0 we condensed a big case statement in PutSQL down to this (around line 728):

      stmt.setObject(parameterIndex, parameterValue, jdbcType);
      

      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:

      case Types.INTEGER:
                          stmt.setInt(parameterIndex, Integer.parseInt(parameterValue));
                          break;
      

      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.

      Attachments

        Issue Links

          Activity

            People

              bbende Bryan Bende
              bbende Bryan Bende
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: