You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/12/31 03:20:32 UTC

[GitHub] [druid] qinzhen353 commented on a change in pull request #10721: javascript filter result convert to java boolean

qinzhen353 commented on a change in pull request #10721:
URL: https://github.com/apache/druid/pull/10721#discussion_r550385717



##########
File path: processing/src/main/java/org/apache/druid/query/filter/JavaScriptDimFilter.java
##########
@@ -327,7 +335,8 @@ public boolean applyInContext(Context cx, Object input)
       if (extractionFn != null) {
         input = extractionFn.apply(input);
       }
-      return Context.toBoolean(fnApply.call(cx, scope, scope, new Object[]{input}));
+      Object fnResult = fnApply.call(cx, scope, scope, new Object[]{input});
+      return Context.toBoolean(boolConvApply.call(cx, scope, scope, new Object[] {fnResult}));

Review comment:
       Thanks, it works. I change to use this way, and add more unit test for other return type.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org