Druid Query for null dimensions


Use case here is to search for all the dimensions which has null values, I am trying to use search query spec (http://druid.io/docs/latest/querying/searchqueryspec.html) but problem here value is actually string, I want to search for **null **not “null”.

I can use Timeseries query with selector filter but there has to be a separate query per dimension in that case.


** “queryType”: “timeseries”,**

** “dataSource”: “ds”,**

** “granularity”: “day”,**

** “aggregations”: [{**

** “type”: “longSum”,**

** “name”: “count”,**

** “fieldName”: “count”**

** }],**

"filter": {

"type": “and”,

"fields": [

{ “type”: “selector”, “dimension”: “dim1”, “value”:null }

Hi Sindhu,

The SearchQuerySpecs don’t support nulls currently, they’ll always return false on null values.

Maybe you could use a timeseries with filtered aggregators: http://druid.io/docs/latest/querying/aggregations.html#filtered-aggregator

You could have a separate filtered count agg for each dimension that might have null values, where the filter is (dimX == null), and look for aggs > 0 in the results.



I haven't double checked the code to see if this has changed, but
empty string and null were the same thing at one point in time, so if
you search for the empty string, it might still return all the nulls.