Sample
Return a random sample of the rows.
Return a random sample of the rows
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| Options | ||||
rows | If a whole number, will select that number of rows. If a decimal between 0 and 1 will select that fraction of the rows e.g. 0.1 => 10% of rows will be returned. | integer, number | — | Yes |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name. | array, object | — | No |
Examples
wrangles:
- select.sample:
rows: 2
| Product | Manufacturer |
|---|---|
| Ball Bearing | SKF |
| Bearing Race | Timken |
| Needle Bearing | Acme Bearings |
| Roller Bearing | General Bearing Co. |
| Product | Manufacturer |
|---|---|
| Ball Bearing | SKF |
| Needle Bearing | Acme Bearings |
wrangles:
- select.sample:
rows: .25
| Product | Manufacturer |
|---|---|
| Ball Bearing | SKF |
| Bearing Race | Timken |
| Needle Bearing | Acme Bearings |
| Roller Bearing | General Bearing Co. |
| Product | Manufacturer |
|---|---|
| Needle Bearing | Acme Bearings |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 59 |
| Catalog key | select.sample |
| Recipe key | select.sample |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | select |
| Documentation group | select |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.select.sample |
| Legacy UUID | 95a84ab6-a66e-450f-8a4a-7a87e3a77932 |
Sources