Matt Burgess created NIFI-1412:
----------------------------------

             Summary: JdbcCommon.createSchema() throws exception when no 
columns are present
                 Key: NIFI-1412
                 URL: https://issues.apache.org/jira/browse/NIFI-1412
             Project: Apache NiFi
          Issue Type: Bug
            Reporter: Matt Burgess


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.



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

Reply via email to