For some color: PropertiesFileLookupService uses the PropertiesConfiguration 
[1] from Apache Commons Config for the underlying implementation so it’s 
assuming the structure of Java properties file and those are just key=value as 
Pierre noted. Maybe the docs could be improved or calling it 
JavaPropertiesFileLookupService would have more explicitly indicated this 
limitation.

As a hack, it’s not totally uncommon with Java properties files that you do 
things like key.1=value, key.2=value to denote multiple dimensions of the same 
thing and you can probably do something constructive with that here.

As far as limitations in the implementations, I’d say the limitation here isn’t 
the implementation but the (assumed, sorry) format. The stuff implemented with 
commons config should actually make it easy to add something like the YAML or 
JSON configurations though. It could end up being a LookupService that’s as 
simple as:

 public class YAMLFileLookupService extends CommonsConfigurationLookupService< 
YAMLConfiguration> { }

-joey

1. 
https://commons.apache.org/proper/commons-configuration/userguide/howto_properties.html

On Apr 27, 2018, 8:27 AM -0500, Pierre Villard <[email protected]>, 
wrote:
> Correct. Some lookup implementations give you the possibility to deal with 
> several fields at once but it really depends of the impl.
> If you have strong use cases requiring improvements on the existing 
> implementations, feel free to file a JIRA with as much details as possible.
>
> Pierre
>
> > 2018-04-27 11:48 GMT+02:00 françois lacombe <[email protected]>:
> > > Hi Pierre,
> > >
> > > Yes this makes sense.
> > > I understand that file is a simple key=value text format.
> > >
> > > I may have different fields which can take different values for a single 
> > > key.
> > > Example: field1: key=>value1 and field2: key=>value2
> > > Can I put this in the same file and same PropertiesFileLookupService or 
> > > should I create 2 different services with separate configurations ?
> > >
> > > Additonally I wish I can deal with several fields in the same 
> > > LookupRecord processor but it doesn't sound to be possible right ?
> > >
> > > All the best
> > >
> > > François
> > >
> > > > 2018-04-27 11:31 GMT+02:00 Pierre Villard <[email protected]>:
> > > > > Hi,
> > > > >
> > > > > You have to give the path to the properties file (key=value file) 
> > > > > that will be used for your lookup service so that when using 
> > > > > LookupRecord it will look for the value associated to the given key 
> > > > > (with a dynamic property in the processor).
> > > > >
> > > > > Does it make sense?
> > > > >
> > > > > Pierre
> > > > >
> > > > > > 2018-04-27 11:25 GMT+02:00 françois lacombe 
> > > > > > <[email protected]>:
> > > > > > > Hi,
> > > > > > >
> > > > > > > I'm trying to implement data enrichment with LookupRecord and 
> > > > > > > PropertiesFileLookupService.
> > > > > > >
> > > > > > > PropertiesFileLookupService asks me a configuration file but I 
> > > > > > > can't find any doc to know how to fill it.
> > > > > > > Is it Avro schema or something ?
> > > > > > > https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-lookup-services-nar/1.6.0/org.apache.nifi.lookup.PropertiesFileLookupService/index.html
> > > > > > >
> > > > > > >
> > > > > > > Thanks in advance for any hint
> > > > > > >
> > > > > > >
> > > > > > > All the best
> > > > > > >
> > > > > > > François
> > > > >
> > >
>

Reply via email to