This message was deleted.
# general
s
This message was deleted.
j
1. If you have both create and delete records in the same table and the timestamps in separate columns, then how about a simple group by with having clause:
Copy code
select emp_id, emp_name, ..., emp_othercols, max(term_date) term_date
from employees
group by emp_id, emp_name, ..., emp_othercols
having term_date is null
2. Druid segments are immutable once created ... however you can replace a time chunk with data pulled from the same time chunk and modified ... and you can also overwrite a time chunk with a smaller time chunk that contains the data you want to update, so you don't have to replace the entire time chunk. If you want more info about this let me know and I can send you some more info on this.
a
Hello John, Thank You. Will try it out the point 1 on delete case. Yes I want more info on the point 2 on Edit case.
j
Hi Ashok, here's a short writeup I put together recently. Let me know if you have any questions.
👀 1
v
you could have a lookup
employee_id => "true"
that only contains deleted employees then you could do
SELECT * FROM employee WHERE LOOKUP(id, 'deleted_employees') <> 'true'
I created this lookup:
And here is how it works:
since the lookup is materialized and broadcast this would be much faster than a sub query
a
Thanks Vadim, I will check it with lookup
Thank You John, will check your doc, thanks.