node-druid-query icon indicating copy to clipboard operation
node-druid-query copied to clipboard

"in" filter not working

Open Shabhana opened this issue 6 years ago • 5 comments

Tried adding "in" filter to the druid-query as below, client.filter('in', 'txn_mth', ['2019/01','2019/02'])

But the below error


/Users/srajathii/Documents/hikma/Site/node_modules/druid-query/lib/fields/filter.js:23
    throw new FieldError('Bad filter type: ' + type)
    ^

Error: Bad filter type: in
    at filter (/Users/srajathii/Documents/hikma/Site/node_modules/druid-query/lib/fields/filter.js:23:11)
    at GroupByQuery.proto.(anonymous function) [as filter] (/Users/srajathii/Documents/hikma/Site/node_modules/druid-query/lib/query.js:136:34)
    at Object.<anonymous> (/Users/srajathii/Documents/hikma/Site/bin/www:205:4)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)

Can you please help on this?

Shabhana avatar Aug 28 '19 13:08 Shabhana

I think this is simply not supported? I think it's already reported in https://github.com/7eggs/node-druid-query/issues/26.

jkukul avatar Aug 28 '19 13:08 jkukul

But looks "in" filter is added as part of commit feat(fields/filter): add in the filter type

also in documentation mentioned like below:


Query.filter('in', dimension, values)

dimensions string - Dimension to which filter is applied.
values object[] - Values to match.

@jkukul @estliberitas @nothinking

Shabhana avatar Aug 28 '19 13:08 Shabhana

@estliberitas commit https://github.com/7eggs/node-druid-query/commit/03100683607e08acfce96c51218ce1c6d8620e86 is not published to the latest npm version "druid-query": "2.1.0" ?

Shabhana avatar Aug 28 '19 13:08 Shabhana

@Shabhana Yes, it looks like this. This commit was added after last release. You can always install from github though.

jkukul avatar Aug 28 '19 13:08 jkukul

@jkukul I need productionalise my application, so can use only modules from npm registry. any help here is much appreciated.

Shabhana avatar Aug 29 '19 11:08 Shabhana