difference between the previous end time and the current start time

318 views
Skip to first unread message

Naveen

unread,
Jan 22, 2021, 8:43:43 AM1/22/21
to Druid User

Hi.. In Apache Druid, when writing a query, is it possible to get the value a previous row? For e.g., in MySQL I can do that by setting a variable value. I want todo this to find the difference between the previous end time and the current start time of an event.

Peter Marshall

unread,
Feb 2, 2021, 6:16:52 AM2/2/21
to Druid User

Peter Marshall

unread,
Feb 2, 2021, 6:21:29 AM2/2/21
to Druid User
Druid query tasks are executed in parallel on different chunks of the data which themselves may contain rows that did not arrive in order.
The results of the distributed query are merged on the Broker - with a general assumption that it will be a much smaller data set than was originally processed - ie aggregates.
LEAD and LAG do come up a lot though - what kind of data are you dealing with?

Naveen

unread,
Feb 2, 2021, 11:24:52 PM2/2/21
to Druid User
Thanks for the response Peter. Yes I was looking for lag/lead. We are dealing with event logs. Now our approach to handle this scenario  is to introduce a data enrichment step before the event is consumed by Druid.
Reply all
Reply to author
Forward
0 new messages