apache / pinot

Apache Pinot - A realtime distributed OLAP datastore
https://pinot.apache.org/
Apache License 2.0
5.26k stars 1.23k forks source link

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

Open francescomultari opened 2 weeks ago

francescomultari commented 2 weeks ago

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

Jackie-Jiang commented 1 week ago

@xiangfu0 is this fixed?

yashmayya commented 4 days ago

Looks like this should be fixed by https://github.com/apache/pinot/pull/12878 in the upcoming Pinot 1.2.0 release. @francescomultari you can verify by running Pinot from the latest master branch (https://github.com/apache/pinot?tab=readme-ov-file#building-pinot).