nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Austin Duncan <adun...@pyaanalytics.com>
Subject Re: Select Query With Aliases
Date Mon, 23 Oct 2017 19:58:14 GMT
I figured it out. My avro schema was rewriting the column names after I was
aliasing haha. Related question. Is there a way to make it so that I can
use spaces instead of underscores (it says that spaces are an illegal
character) or is it possible for me to erase the first row and replace it
with the column names that I want. I am converting the avro schema into a
csv.

On Mon, Oct 23, 2017 at 3:03 PM, Matt Burgess <mattyb149@apache.org> wrote:

> 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 <aduncan@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
>



-- 
​Austin Duncan
*​Researcher​*

PYA Analytics
2220 Sutherland Avenue
<https://maps.google.com/?q=2220+Sutherland+AvenueKnoxville,+TN+37919+865&entry=gmail&source=g>
Knoxville, TN 37919
<https://maps.google.com/?q=2220+Sutherland+AvenueKnoxville,+TN+37919+865&entry=gmail&source=g>
423-260-4172
<https://maps.google.com/?q=2220+Sutherland+AvenueKnoxville,+TN+37919+865&entry=gmail&source=g>
<%28865%29%20684-2828>

Mime
View raw message