- Apache Tajo Tutorial
- Apache Tajo - Home
- Apache Tajo - Introduction
- Apache Tajo - Architecture
- Apache Tajo - Installation
- Apache Tajo - Configuration Settings
- Apache Tajo - Shell Commands
- Apache Tajo - Data Types
- Apache Tajo - Operators
- Apache Tajo - SQL Functions
- Apache Tajo - Math Functions
- Apache Tajo - String Functions
- Apache Tajo - DateTime Functions
- Apache Tajo - JSON Functions
- Apache Tajo - Database Creation
- Apache Tajo - Table Management
- Apache Tajo - SQL Statements
- Aggregate & Window Functions
- Apache Tajo - SQL Queries
- Apache Tajo - Storage Plugins
- Integration with HBase
- Apache Tajo - Integration with Hive
- OpenStack Swift Integration
- Apache Tajo - JDBC Interface
- Apache Tajo - Custom Functions
- Apache Tajo Useful Resources
- Apache Tajo - Quick Guide
- Apache Tajo - Useful Resources
- Apache Tajo - Discussion
Apache Tajo - lag (value, offset, default)
Let us now check the lag(value,offset,default) function with the following query.
Query
sampledb> select lag(mark,3,2) over (partition by age) as lagvalue from mytable;
Result
The above query will generate the following result.
lagvalue ------------------------------- 2 2 2 90 80 85 55 60 2 2
The query returns the value evaluated at the row that is offset rows before the current row within the partition. Whenever the rows are not matching, then the given default value 2 is replaced.
apache_tajo_aggregate_and_window_functions.htm
Advertisements