[
https://issues.apache.org/jira/browse/NIFI-4644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16270930#comment-16270930
]
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_r153818372
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/src/main/java/org/apache/nifi/hbase/HBase_1_1_2_RecordLookupService.java
---
@@ -114,8 +114,12 @@
}
@Override
- public Optional<Record> lookup(Map<String, String> coordinates) throws
LookupFailureException {
- final String rowKey = coordinates.get(ROW_KEY_KEY);
+ public Optional<Record> lookup(Map<String, Object> coordinates) throws
LookupFailureException {
+ if (coordinates.get(ROW_KEY_KEY) == null) {
+ return Optional.empty();
+ }
+
+ final String rowKey = coordinates.get(ROW_KEY_KEY) instanceof
String ? (String)coordinates.get(ROW_KEY_KEY) :
coordinates.get(ROW_KEY_KEY).toString();
--- End diff --
I don't think we need to be checking any instanceof here -- just call
coordinates.get(ROW_KEY_KEY).toString() -- it is a String, then toString() will
simply return 'this'.
> 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)