Apache Druid semi-join query error

Why do I execute the following SQL statement, the first two SQL statements can return the result correctly, and the third SQL statement reports an error:org.apache.druid.java.util.common.ISE: Cannot build plan for query.

select “TTID”,sum(“busTransCount”) from APP_BBP_TRANSLOG where “__time”>=‘2019-10-08T09:00:00.000Z’ and “__time”<‘2019-10-08T10:00:00.000Z’ and “TTID” in (select “TTID” from APP_BBP_TRANSLOG) group by “TTID”;

select FLOOR("__time" to MINUTE),“TTID”,sum(“busTransCount”) from APP_BBP_TRANSLOG where “__time”>=‘2019-10-08T09:00:00.000Z’ and “__time”<‘2019-10-08T10:00:00.000Z’ and “TTID” in (‘TX990022’,‘TX816402’) group by FLOOR("__time" to MINUTE),“TTID”;

select FLOOR("__time" to MINUTE),“TTID”,sum(“busTransCount”) from APP_BBP_TRANSLOG where “__time”>=‘2019-10-08T09:00:00.000Z’ and “__time”<‘2019-10-08T10:00:00.000Z’ and “TTID” in (select “TTID” from APP_BBP_TRANSLOG) group by FLOOR("__time" to MINUTE),“TTID”;

thanks.

Hey Xianhai,

Hmm, I’m not sure. I don’t notice any differences between queries 1 and 3 that should affect the ability to plan. I would suggest filing an issue on github, especially helpful if you have a test case that can reproduce this in CalciteQueryTest (but still useful even if you don’t).

Gian