druid
druid copied to clipboard
SQL query fails in semi join when using NOT IN with subquery
Affected Version
0.16.0
Description
Executing an SQL query from UI,
SELECT dimension, SUM(totals)
FROM datasource
WHERE "__time" BETWEEN TIME_FORMAT(TIMESTAMPADD(DAY, -2,CURRENT_DATE), 'yyyy-MM-dd hh:mm:ss')
AND TIME_FORMAT(TIMESTAMPADD(DAY, -1,CURRENT_DATE), 'yyyy-MM-dd hh:mm:ss')
AND dimension NOT IN (
SELECT dimension from datasource1 WHERE d="example"
)
GROUP BY dimension
Gets me:
Unknown exception / Cannot build plan for query:
followed by the original query.
The exact same query works when i use IN keyword.
This is a known issues the x IN (...) is actually a special case, this will be addressed by https://github.com/apache/incubator-druid/issues/8728