Question on "IN" filter in druid

Hello,

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

{
“type”: “in”,
“dimension”: “state”,
“values”: [
“CA”,
“TX”
]
}

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,

Aditya.

Not in the Druid native query language, although in Druid SQL (http://druid.io/docs/latest/querying/sql.html) 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”.