Skip to content

LEAD and LAG window functions not functioning as expected in version 1.1.0 #13454

@francescomultari

Description

@francescomultari

Description
It has been observed that the LEAD and LAG window functions are not producing the expected results when used in our SQL queries. These functions are intended to access data from subsequent or preceding rows within the same result set, but they appear to be accepted among the windows functions

Steps to Reproduce
Use the LEAD or LAG window functions in a SQL query.
Compare the output with the expected results.

Expected Behavior
The LEAD function should return the value from the next row, and the LAG function should return the value from the previous row, as per their functionality.

Actual Behavior
Used the following query:

select id,name, LEAD(name,1) OVER (ORDER BY x)
from table
limit 10

Error obtained when using LEAD or LAG functions

image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmulti-stageRelated to the multi-stage query enginewindow-functionsRelated to SQL window functions on the multi-stage query engine

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions