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

PutDatabaseRecord throws RecordPathException even when RecordPath is not set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Extensions
    • None

    Description

      PutDatabaseRecord's initialization has the following logic:

      final String statementTypeRecordPathValue = context.getProperty(STATEMENT_TYPE_RECORD_PATH).getValue();
      if (statementTypeRecordPathValue == null) {
          recordPathOperationType = null;
      } else {
          final RecordPath recordPath = RecordPath.compile(statementTypeRecordPathValue);
          recordPathOperationType = new RecordPathStatementType(recordPath);
      } 

      This assumes that the RecordPath is valid or is not set. But that's necessarily the case. Because the STATEMENT_TYPE_RECORD_PATH property depends on the "Statement Type" property being set to "RecordPath", it is possible to set the Statement Type to RecordPath, set an invalid RecordPath, and then change the Statement Type to something else, such as INSERT.

      Now, the Processor fails to start, with a cryptic error message.

      The Processor needs to be updated to ensure that it does not attempt to compile the RecordPath unless the "Statement Type" property is set to "RecordPath".

      Attachments

        Activity

          People

            Unassigned Unassigned
            markap14 Mark Payne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: