You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Karthik Narayanan (JIRA)" <ji...@apache.org> on 2016/11/18 05:29:58 UTC
[jira] [Commented] (NIFI-3064) ExecuteSQL convert to Avro fails
when a MySQL query returns two columns with the same name even with
different aliases
[ https://issues.apache.org/jira/browse/NIFI-3064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15675832#comment-15675832 ]
Karthik Narayanan commented on NIFI-3064:
-----------------------------------------
is it worth having an if...so we can do based on the type of db.
If mysql|oracle
nameorLabel= label!=null?label:name
else
nameorLabel= name!=null?name:label
just a thought
> ExecuteSQL convert to Avro fails when a MySQL query returns two columns with the same name even with different aliases
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-3064
> URL: https://issues.apache.org/jira/browse/NIFI-3064
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.0.0, 0.7.0, 0.6.1
> Reporter: Karthik Narayanan
> Assignee: Matt Burgess
>
> For the following query:
> select A.host as host1,B.host as host from `hosts` A join host2 B on B.hostid=A.hostid;
> A.host and B.host are columns that have same name, but come from different tables, and have a different alias name. But looks like Avro conversion is ignoring the alias and just looking at the column name. This causes the query to fail with this error
> Duplicate Field Name in any.data.hosts ; name type UNION pos:1 and name type UNION pos:0.
> I have attached a screenshot for the same.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)