BottomK / Manipulation Layer
Select the bottom K rows after sorting by specified column(s). Similar to pandas' nsmallest() or SQL's ORDER BY with LIMIT.
Key features:
- Multi-column sorting support
- Customizable null handling
- Order preservation options
Common applications:
- Finding lowest values (prices, scores, metrics)
- Identifying worst performers
- Bottom percentile analysis
- Outlier detection
- Ranking and prioritization
Example: With K=5, get the 5 products with lowest prices, or 5 students with lowest test scores.
Table
0
0
Table
SortBy
[, ...]Ordered list of columns defining the sort criteria. Multiple columns enable:
- Primary and secondary sort keys
- Tie-breaking rules
- Complex sorting hierarchies Example: sort by price, then by rating for same-price items.
Select
columnColumn to use in sort criteria. Examples:
- Numerical: prices, scores, measurements
- Temporal: dates, timestamps
- Text: names, codes (alphabetical) Multiple columns create a hierarchical sort order.
Descending
boolControls sort direction for this column:
false
(default): Ascending (smallest first)true
: Descending (largest first) Useful for mixed sorting requirements.
K
u32Number of rows to select from the bottom of sorted data. Examples:
- 10 lowest prices
- 5 worst-performing items
- 20 oldest records Must be positive and not exceed total row count.
NullsLast
boolControls null value placement in sort order:
false
(default): Nulls firsttrue
: Nulls last Important for datasets with missing values.
MaintainOrder
boolControls stability of sort within equal values:
false
(default): May reorder equal valuestrue
: Preserves original order of equal values Critical for reproducible results or order-sensitive data.