Head / GroupBy Layer

Select first N rows from each group, similar to pandas groupby().head() or dplyr's group_by() with slice_head().

Example scenarios:

  1. Latest Products Per Category
ConfigurationResult
by=[category]Group products by category
n=3Take 3 newest products
select=[product_id, launch_date]Get product details
  1. Top Sales Per Region
ConfigurationResult
by=[region, quarter]Group by location and time
n=5Take 5 highest records
select=[sales_id, amount]Get sales information

Common applications:

  • Most recent events per category
  • Top performers by department
  • Latest entries per group
  • Initial readings per batch
  • First responses per survey
Table
0
0
Table

By

[column, ...]

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

  • [customer_id]: First N purchases per customer
  • [product_id, store_id]: First N sales per product per store
  • [department, year]: First N projects per department yearly

N

u32
1

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

  • 1: First item only
  • 3: Top three entries
  • 5: Top five records
  • 10: Top ten items

Select

[column, ...]

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

  • [timestamp, value]: Time and measurement
  • [order_id, amount]: Order details
  • [student_id, score]: Student performance