What limits Dremio "Lead" only support offset 1?



if i wanna support offset bigger than 1, where can i start?
any advice, Thanks!


Hi @jerryldh,

Can you provide a profile for the query where you encounter this. Can you give more context?



this is snapshot of my table,
when i query "SELECT id,name,age,lead(id,1) OVER (PARTITION BY DEPARTMENT_ID) "
for “lead” function, offset only support “1”,
if i query “SELECT id,name,age,lead(id,2) OVER (PARTITION BY DEPARTMENT_ID)”, same result returns.
i wanna know how can i fix this.
in source code “UnsupportedOperatorsVisitor.java”, i find that “we don’t support offset != 1”. so where should i start to support other offset value?



another issue
as you can see in picture above,
some values missd,
for EXPR$3 values should be “2,1,4,3,5,NULL”
but returns “2,NULL,4,3,NULL,NULL”.
i’m not sure if it’s caused by a bug or other reason.