Tail / GroupBy Layer

Select last N rows from each group, similar to pandas groupby().tail() or dplyr's group_by() with slice_tail().

Example scenarios:

  1. Most Recent Customer Interactions
ConfigurationResult
by=[customer_id]Group by customer
n=2Last 2 interactions
select=[date, interaction_type]Get interaction details
  1. Final Readings Per Sensor
ConfigurationResult
by=[sensor_id, date]Group by sensor and day
n=3Last 3 readings
select=[timestamp, reading]Get measurement details

Common applications:

  • Latest status updates
  • Most recent transactions
  • Final measurements
  • Recent customer contacts
  • Latest system states
Table
0
0
Table

By

[column, ...]

Columns to group by. Creates separate groups for selecting last N rows. Examples:

  • [machine_id]: Last N readings per machine
  • [employee_id, project_id]: Last N tasks per employee per project
  • [customer_id, year]: Last N purchases per customer yearly

N

u32
0

Number of rows to select from each group (minimum 1). Common values:

  • 1: Most recent item
  • 3: Last three entries
  • 5: Last five records
  • 10: Last ten items

Select

[column, ...]

Columns to include in the result. Default ['*'] selects all columns. Examples:

  • [timestamp, status]: Recent states
  • [transaction_id, amount]: Latest transactions
  • [reading_time, value]: Final measurements