Filter using a lookup value while using "globally cached lookups "

Hi people,

I am using Druid 0.11.0 and added globally cached lookups that connect to jdbc.

Everything works smoothly and now the next challenge is to filter.

Using a normal filter, doesn’t actually apply any filtering:

“filter”: {

“type”: “in”,

“field”: {

“dimension”: “dimension_name”,

“value”: “value_to_filter”,

“type”: “selector”

}

}

``

If I try to use a selector filter with an extraction function, it fails with a null pointer exception:

“filter”: {
“type”: “selector”,
“dimension”: “dimension_name”,
“value”: “value_to_filter”,
“extractionFn”: {
“type”: “lookup”,
“name”: “name_of_the_lookup”
}
}

``

java.lang.NullPointerException
at io.druid.query.filter.InDimFilter.optimizeLookup(InDimFilter.java:172) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.filter.InDimFilter.optimize(InDimFilter.java:148) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.filter.SelectorDimFilter.optimize(SelectorDimFilter.java:91) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.filter.ExtractionDimFilter.optimize(ExtractionDimFilter.java:98) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.groupby.GroupByQueryQueryToolChest$7.run(GroupByQueryQueryToolChest.java:334) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.SubqueryQueryRunner.run(SubqueryQueryRunner.java:45) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.UnionQueryRunner.run(UnionQueryRunner.java:68) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.ResultMergeQueryRunner.doRun(ResultMergeQueryRunner.java:46) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.BySegmentSkippingQueryRunner.run(BySegmentSkippingQueryRunner.java:47) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.groupby.strategy.GroupByStrategyV2.mergeResults(GroupByStrategyV2.java:257) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.groupby.GroupByQueryQueryToolChest.mergeGroupByResults(GroupByQueryQueryToolChest.java:221) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.groupby.GroupByQueryQueryToolChest.initAndMergeGroupByResults(GroupByQueryQueryToolChest.java:145) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.groupby.GroupByQueryQueryToolChest.access$100(GroupByQueryQueryToolChest.java:73) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.groupby.GroupByQueryQueryToolChest$3.run(GroupByQueryQueryToolChest.java:124) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.FinalizeResultsQueryRunner.run(FinalizeResultsQueryRunner.java:104) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.CPUTimeMetricQueryRunner.run(CPUTimeMetricQueryRunner.java:64) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.FluentQueryRunnerBuilder$FluentQueryRunner.run(FluentQueryRunnerBuilder.java:56) ~[druid-processing-0.11.0.jar:0.11.0]
at io.druid.query.QueryPlus.run(QueryPlus.java:129) ~[druid-processing-0.11.0.jar:0.11.0]

Any ideas?

Try the “registeredLookup” extractionFn instead.