Apache Tajo - lead (value, offset, default)



Let us now check the lead(value,offset,default) function with the following query.

Query

sampledb> select lead(mark,3,2) over (partition by age) as leadvalue from mytable;   

Result

The above query will generate the following result.

leadvalue 
------------------------------- 
55 
60 
70 
75 
95 
2 
2 
2 
2 
2 

The query returns the value evaluated at the row that is offset rows after the current row within the partition. If no such rows are present, then the given default value 2 is replaced.

apache_tajo_aggregate_and_window_functions.htm
Advertisements