Sample Rows
Pull a small random slice out of a big table.
What it does
Sample Rows picks rows at random and drops the rest. Nothing is sorted, and no column is involved. Use it on a large file to test an idea fast. You can then remove the step and run the same work on every row.
Take a sample of rows
- Type sample in the Search transforms box, in the Pipeline panel.
- Select Sample Rows in the results list.
- Look at Sample by. It is already set to rows.
- Type a row count in Sample size. For example, type 500.
- Click Apply.
Example: a web server log has two million rows. A sample of 500 rows loads at once. You can then try a date split or a filter on it.
Sample a percentage instead
Open Sample by and select percent. Now Sample size means a percentage, not a row count. Type 5 to keep about 5 percent of the rows. The value must stay at 100 or below.
Percent mode grows with your table. Rows mode gives you the same count every time.
Get the same sample twice
A sample is different on each run by default. To lock it, use the third field:
- Type any whole number in Random seed (optional, for reproducibility).
- Click Apply.
The same seed and the same size always return the same rows. Share the seed with a colleague to compare notes on the same slice. Leave the field empty for a fresh sample on each run.
For SQL users
The step uses reservoir sampling in DuckDB. A seeded sample of 500 rows runs as:
SELECT * FROM data USING SAMPLE 500 ROWS (RESERVOIR, 42)
Try Sample Rows with sample data →
Related Operations
- Filter - Show only rows matching conditions
- Limit Rows - Keep only the first N rows
- Top / Bottom Rows - Show top or bottom N rows by column value