Well good news, shuffle joins are coming in Druid 26. Until then, for your specific use-case, could you compare earliest(Sal) with latest(Sal) when grouping on Id?
👀 1
v
Vijay Narayanan
03/23/2023, 7:34 AM
will you have only two rows for each id? You could compute a max and min for sal grouped by id and in the outer query compare the max and min and set the flag something like
Copy code
select id,case when maxsal!=minsal then 1 else 0 end from (select id,max(sal) maxsal,min(sal) minsal from table group by id)