druid icon indicating copy to clipboard operation
druid copied to clipboard

SQL query fails in semi join when using NOT IN with subquery

Open stelios313 opened this issue 7 years ago • 1 comments

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.

stelios313 avatar Nov 06 '19 16:11 stelios313

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

vogievetsky avatar Nov 08 '19 21:11 vogievetsky