[
https://issues.apache.org/jira/browse/NIFI-4644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16270937#comment-16270937
]
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_r153818623
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/configuration2/CommonsConfigurationLookupService.java
---
@@ -122,12 +122,12 @@ public void onEvent(ConfigurationBuilderEvent event) {
}
@Override
- public Optional<String> lookup(final Map<String, String> coordinates)
throws LookupFailureException {
+ public Optional<String> lookup(final Map<String, Object> coordinates)
throws LookupFailureException {
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)