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

QueryNiFiReportingTask gives error when joining tables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.27.0
    • None
    • None

    Description

      Using QueryNiFiReportingTask in 1.x, an error occurs when doing a join on tables, such as:

      SELECT
      CONNECTION_STATUS.id,
      CONNECTION_STATUS.name,
      CONNECTION_STATUS.sourceName,
      CONNECTION_STATUS.destinationName,
      CONNECTION_STATUS.queuedCount,
      CONNECTION_STATUS.backPressureObjectThreshold,
      CONNECTION_STATUS_PREDICTIONS.predictedTimeToCountBackpressureMillis
      FROM CONNECTION_STATUS
      JOIN CONNECTION_STATUS_PREDICTIONS ON CONNECTION_STATUS_PREDICTIONS.connectionId = CONNECTION_STATUS.id
      WHERE
      predictedTimeToCountBackpressureMillis < 300000
      OR (backPressureObjectThreshold <> 0 AND queuedCount * 100 / backPressureObjectThreshold > 75)

      The error is:

      2024-06-13 17:26:03,034 INFO org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent: QueryNiFiReportingTask[id=1229bc0c-0190-1000-ffff-ffffca3d5135] started.
      2024-06-13 17:26:03,048 ERROR org.apache.nifi.reporting.sql.QueryNiFiReportingTask: QueryNiFiReportingTask[id=1229bc0c-0190-1000-ffff-ffffca3d5135] Error running task QueryNiFiReportingTask[id=1229bc0c-0190-1000-ffff-ffffca3d5135] due to java.lang.AssertionError: Rule's description should be unique; existing rule=ConnectionStatusProjectTableScanRule; new rule=ConnectionStatusProjectTableScanRule
      2024-06-13 17:26:06,437 INFO org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent: Stopped scheduling QueryNiFiReportingTask[id=1229bc0c-0190-1000-ffff-ffffca3d5135] to run

      This is because the ScanRules use a singleton instance. The main (2.x) branch does not suffer from this because that bundle has been since refactored, but we should fix it on the 1.x branch. The ScanRule implementations should create new instances as necessary, and the description field is not necessary.

      Attachments

        Issue Links

          Activity

            People

              mattyb149 Matt Burgess
              mattyb149 Matt Burgess
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: