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

JdbcCommon.createSchema() throws exception when no columns are present

    XMLWordPrintableJSON

Details

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

    Description

      The discovery of the bug in NIFI-1409 was a result of an exception being thrown when no columns were present in a result set returned by a query in the ExecuteSql processor. While NIFI-1409 is concerned with handling all such exceptions, this case is for the aforementioned exception.

      The problem seems to be in JdbcCommon.createSchema():
      https://github.com/apache/nifi/blob/nifi-0.4.1/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/JdbcCommon.java#L130
      This line asks for the table name for the first column, and when there are no columns, a SQLException is thrown.

      The Avro docs suggest that no fields are necessary for the schema to be valid, so if there are no columns in the result set, a schema with no fields should be returned, rather than an exception being thrown.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: