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

ExecuteSQL convert to Avro fails when a MySQL query returns two columns with the same name even with different aliases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0, 0.7.0, 0.6.1
    • 1.1.0
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              rkarthik29@gmail.com Karthik Narayanan
              rkarthik29@gmail.com Karthik Narayanan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: