Skip to content

Convert SQL Lag query to Druid #13474

@Jaytimbadia7

Description

@Jaytimbadia7

Hey Druid!

We have a query written in SQL which contains LAG function. We need that query in Druid SQL. Can you please lead us?

Example SQL query:

SELECT
  time_col,
  id,
  (time_col - lag (time_col, 1) over ( partition by id order by time_col)) as time_elapsed
FROM datatable

Can you please let us know its Druid conversion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions