Austin,

What version of NiFi are you using? There was an issue with aliases
(at least for MySQL) before NiFi 1.1.0, fixed by NIFI-3064 [1].  Also
what database and driver version are you using?  Since NiFi 1.1.0, we
are following the JDBC 4 spec which says the drivers (when
getColumnLabel is called) should be returning the alias for the
column, if not it will have the column name. If the driver doesn't
comply with that (for example Postgres, which I think returns null),
we will call getColumnName() instead. Depending on your DB and driver,
you might be getting the column name returned by getColumnLabel,
instead of the alias which is the correct thing to return. In that
case I don't think there's anything NiFi can do about it, since the
JDBC would be out of spec at that point.

Regards,
Matt

[1] https://issues.apache.org/jira/browse/NIFI-3064

On Mon, Oct 23, 2017 at 2:56 PM, Austin Duncan <adun...@pyaanalytics.com> wrote:
> I am using an executesql processor to perform a select query. I want to
> select data from a table and have the column names displayed as something
> else (alias). Example would be select answer_1 as "how_did_it_go" from
> schema.table. When I run a flowfile through it it queries the data but the
> alias is not applied. Does nifi not have this functionality or is there
> something wrong with my query. Thanks
>
> --
> Austin Duncan
> Researcher
>
> PYA Analytics
> 2220 Sutherland Avenue
> Knoxville, TN 37919
> 423-260-4172

Reply via email to