Extraction filter with time format function not working

Hi,

I can’t get an extraction filter, which uses a time format extraction function, to return me any results. Am I doing something wrong?

I’m using the batch ingestion wikipedia example - the six rows of data included at examples/indexing/wikipedia_data.json. (Data also appears here.)

Also, I’m running only a historical and broker node (because that’s how my integration tests are set up to run). I’m querying the historical node directly. Druid version 0.8.2

Using the time format extraction function as a dimension spec works just fine:

Query:

{

“dataSource”: “druid-client-test”,

“dimensions”: [

"continent",
{
  "dimension": "__time",
  "extractionFn": { "format": "HH", "type": "timeFormat"},
  "outputName": "hod",
  "type": "extraction"
}

],

“granularity”: “all”,

“aggregations”: [{“name”: “count_it”, “type”: “count”}],

“intervals”: [“2013-08-31T01:02:33.000Z/2013-09-01T12:41:27.000Z”],

“queryType”: “groupBy”

}

Result:

[ {

“version” : “v1”,

“timestamp” : “2013-08-31T01:02:33.000Z”,

“event” : {

"continent" : "Asia",
"count_it" : 1,
"hod" : "07"

}

}, {

“version” : “v1”,

“timestamp” : “2013-08-31T01:02:33.000Z”,

“event” : {

"continent" : "Asia",
"count_it" : 1,
"hod" : "11"

}

}, {

“version” : “v1”,

“timestamp” : “2013-08-31T01:02:33.000Z”,

“event” : {

"continent" : "Asia",
"count_it" : 1,
"hod" : "12"

}

}, {

“version” : “v1”,

“timestamp” : “2013-08-31T01:02:33.000Z”,

“event” : {

"continent" : "Australia",
"count_it" : 1,
"hod" : "03"

}

}, {

“version” : “v1”,

“timestamp” : “2013-08-31T01:02:33.000Z”,

“event” : {

"continent" : "North America",
"count_it" : 1,
"hod" : "01"

}

} ]

But if I add a filter to the query that uses the exact same extraction function, I get no results:

Query:

{

“dataSource”: “druid-client-test”,

“dimensions”: [

"continent",
{
  "dimension": "__time",
  "extractionFn": { "format": "HH", "type": "timeFormat"},
  "outputName": "hod",
  "type": "extraction"
}

],

“granularity”: “all”,

“aggregations”: [{“name”: “count_it”, “type”: “count”}],

“intervals”: [“2013-08-31T01:02:33.000Z/2013-09-01T12:41:27.000Z”],

“filter”: {

 "dimension": "__time",
 "value": "01",
 "extractionFn": { "format": "HH", "type": "timeFormat" },
 "type": "extraction"

},

“queryType”: “groupBy”

}

Result:

Am I doing something wrong, or is this broken?

Answered in https://github.com/druid-io/druid/issues/2652