Question on "IN" filter in druid


I understand we can specify values explicitly for IN filter as shown below,

“type”: “in”,
“dimension”: “state”,
“values”: [

Is there a way to dynamically specify the values (i.e from output of a sub query)

Sample SQL query:

SELECT state

FROM Table1

WHERE state IN (SELECT distinct state from Table1 where population > 10000000)

Thank you,


Not in the Druid native query language, although in Druid SQL ( the query you wrote should work literally without changes. Although note that it works by a special process that limits the number of possible distinct “state” values. See the Druid SQL docs for more details under “Semi-joins”.