Filtered DimensionSpecs Java API example

Hello everyone,

I’m trying make Filtered DimensionSpecs using druid java API same as explained http://druid.io/docs/latest/querying/dimensionspecs.html#filtered-dimensionspecs.

These are only valid for multi-value dimensions. If you have a row in druid that has a multi-value dimension with values [“v1”, “v2”, “v3”] and you send a groupBy/topN query grouping by that dimension with query filter for value “v1”. In the response you will get 3 rows containing “v1”, “v2” and “v3”. This behavior might be unintuitive for some use cases.

I need only v1 row.

But I can’t find any examples of how using it.

Any clue appreciate.

Regards,

Valentin.

I’m used DimensionSpec spec = new ListFilteredDimensionSpec(new DefaultDimensionSpec(“domains”, “domains”), Sets.newHashSet(“domain.com”), true);

your dimensionSpec seems correct. Let us know if you face any issues with it.