ERROR IN QUERY

25 views
Skip to first unread message

Sachin VS

unread,
Jan 11, 2023, 4:01:21 AM1/11/23
to Druid User
When i run this query 

select * from "countif_data" c1
left join "countif_data" c2 on c2.ID = c1.ID and c1.__time >= c2.__time

shows this error

Error: SQL query is unsupported

Query not supported. Possible error: SQL requires a join with 'GREATER_THAN_OR_EQUAL' condition that is not supported. SQL was: select c1.__time from "countif_data" c1 left join "countif_data" c2 on c2.ID = c1.ID and c1.__time >= c2.__time

org.apache.calcite.plan.RelOptPlanner$CannotPlanException

Ben Krug

unread,
Jan 11, 2023, 7:31:03 PM1/11/23
to druid...@googlegroups.com
Hello Sachin -

So far druid only supports joins on equality conditions.  So the c1.__time >= c2.__time won't work.
You could do something like 

select * from "countif_data" c1
left join "countif_data" c2 on c2.ID = c1.ID 
where c1.__time >= c2.__time

although I can't vouch for the performance of such a join.  :)

--
You received this message because you are subscribed to the Google Groups "Druid User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-user/48e49e82-2e06-4e08-a553-8c221526cf2en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages