Skip to main content

Sample

Return a random sample of the rows.

Return a random sample of the rows

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
Options
rowsIf 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
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No

Examples​

wrangles:
- select.sample:
rows: 2
ProductManufacturer
Ball BearingSKF
Bearing RaceTimken
Needle BearingAcme Bearings
Roller BearingGeneral Bearing Co.
ProductManufacturer
Ball BearingSKF
Needle BearingAcme Bearings
wrangles:
- select.sample:
rows: .25
ProductManufacturer
Ball BearingSKF
Bearing RaceTimken
Needle BearingAcme Bearings
Roller BearingGeneral Bearing Co.
ProductManufacturer
Needle BearingAcme Bearings
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID59
Catalog keyselect.sample
Recipe keyselect.sample
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceselect
Documentation groupselect
AliasesNone
Runtime symbolwrangles.recipe_wrangles.select.sample
Legacy UUID95a84ab6-a66e-450f-8a4a-7a87e3a77932

Sources