[
https://issues.apache.org/jira/browse/NIFI-1412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15111230#comment-15111230
]
ASF GitHub Bot commented on NIFI-1412:
--------------------------------------
GitHub user mattyb149 opened a pull request:
https://github.com/apache/nifi/pull/182
NIFI-1412: Fix error during Avro conversion where no fields are present
Changes the logic so no exception is thrown when meta.getColumnCount()
returns 0, instead an empty Avro schema is produced.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mattyb149/nifi NIFI-1412
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/182.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #182
----
commit 65aacf7d1b75a3c5483ce0635f778ab1727ed5b3
Author: Matt Burgess <[email protected]>
Date: 2016-01-21T20:20:14Z
NIFI-1412: Fix error during Avro conversion where no fields are present
----
> 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)