Toivo,

There has been some discussion on ControllerService(s) to do
input/output conversion, and Peter Wicks has been working on such an
implementation:

https://github.com/patricker/nifi/commits/RowProcessorService

I haven't had time to take a close look at this, but it definitely has
promise, and I'm sure he would appreciate any feedback if you'd like
to take a look.

The ControllerService approach vs a classpath approach may be more of
a packaging or philosophical exercise. To have that converter in the
classpath, it would need to be a JAR or NAR. The implementation would
need JSON JARs, as would the XML impl need more third-party JARs and
so on. We likely can't put this all in a NAR because some NARs that
would want to use these services already have a parent NAR, and in
NiFi you can only have one parent NAR.  JSON and XML happen to be poor
examples for my point because right now all the appropriate JARs are
in the nifi-standard-bundle. However if a processor outside the
standard bundle (such as SelectHiveQL in the hive bundle) wants to use
these implementations, it will need access via the API to get the
providers from various other NARs. The ControllerService approach
already has this in place.

This is a high-value improvement so I'm very happy to see and be a
part of the discussion. I hope we can get something we're all
comfortable with going forward, as this should be a great addition to
NiFi.

Regards,
Matt




On Sat, Sep 3, 2016 at 8:14 AM, Toivo Adams <[email protected]> wrote:
> Hi Andrew,
>
> My initial idea was something like.
>
> import java.io.OutputStream;
> import java.sql.ResultSet;
>
> public interface ResultSetConverter {
>
>         public long convertToAvroStream(final ResultSet rs, final OutputStream
> outStream);
> }
>
> and implementation for example
>
> public class ToJSONConverter implements ResultSetConverter {
>
>         public long convertToAvroStream(ResultSet rs, OutputStream outStream) 
> {
>
>                 // here to JSON stream converting logic
>
>
>                 return 0;
>         }
> }
>
> And property OutputConverter should have value:
>      ToJSONConverter.class
>
> And  ToJSONConverter class should be in classpath.
> No control service is needed.
>
>
> Thanks
> Toivo
>
>
>
> --
> View this message in context: 
> http://apache-nifi-developer-list.39713.n7.nabble.com/ExecuteSql-output-formats-tp13265p13267.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Reply via email to