You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Jairo Henao <ja...@gmail.com> on 2021/02/04 22:02:00 UTC

Better approach to run SQL and load it as attribute

Hi all,

I need in several cases of my process to execute a SQL that counts and
averages data from a table. This is a SQL with two columns and one row that
I always need to load as an attribute, so I use: ExecuteSQL ->
RouteOnAttribute (To check the executesql.row.count != 0) ->
ConvertAvroTOJSON -> EvaluateJsonPath.

I would like the simplest approach, is there a shorter one?

Two things that would be good to improve/do:


   - ExecuteSQL should be configured so that it does not generate output
   flow if there are no results or that it has a new relationship (e.g. not
   data returned)
   - Create a new processor that does these steps, something like an
   ExecuteSQLToAttributes.


Thanks,


-- 
Jairo Henao
@jairohenaorojas