[
https://issues.apache.org/jira/browse/NIFI-4644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16270932#comment-16270932
]
ASF GitHub Bot commented on NIFI-4644:
--------------------------------------
Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2304#discussion_r153818578
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/SimpleKeyValueLookupService.java
---
@@ -58,12 +58,12 @@ public void cacheConfiguredValues(final
ConfigurationContext context) {
}
@Override
- public Optional<String> lookup(final Map<String, String> coordinates) {
+ public Optional<String> lookup(final Map<String, Object> coordinates) {
if (coordinates == null) {
return Optional.empty();
}
- final String key = coordinates.get(KEY);
+ final String key = coordinates.get(KEY) instanceof String ?
(String)coordinates.get(KEY) : coordinates.get(KEY).toString();
--- End diff --
Again, no need to check instanceof here - can just call toString()
> LookupService should support more than String,String key value pairs
> --------------------------------------------------------------------
>
> Key: NIFI-4644
> URL: https://issues.apache.org/jira/browse/NIFI-4644
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Mike Thomsen
> Assignee: Mike Thomsen
>
> The current interface is:
> {code:java}
> T lookup(Map<String, String> coordinates)
> {code}
> Limiting that to String, String has already caused problems for people using
> the MongoDBLookupService. For example, a user wanting to do a lookup using a
> String/Integer combination will find that the type is converted to
> String/String automatically and it will fail against any data source that
> cannot automatically make that conversion.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)