Sampler
Preserves either a total number of features or a sampling of features, depending on the Sampling Type selection. The remainder of the input features are discarded.
This transformer is typically used during testing to reduce data volume by arbitrarily discarding data.
Parameters
When specified, this parameter affects the behavior of the two sampling types. For example, say the Sampler receives a set of 15 features. Using the Group By parameter, the Sampler breaks the features into 3 groups.
- Group 1 has 3 features
- Group 2 has 5 features
- Group 3 has 7 features
This table shows how sampling amount and type affect the Group By results:
Sampling Amount | Sampling Type | Result |
---|---|---|
4 | Every Nth Feature |
|
4 | First N Features |
|
Determines the number of features to keep: either a total number of features, or a sampling of features.
- 1: No data will be discarded: the same number of features will be the same for input and output.
- 0: All input data will be discarded.
For example:
Sampling Rate | Sampling Type | Result |
---|---|---|
2 | Every Nth Feature | Every second feature will be kept. |
10 | First N Features | Only the first 10 features will be kept. All subsequent features will be consumed by the transformer. |
When this parameter is left at the default setting of No, the transformer works with features in the order in which they are received.
Setting this parameter to Yes means that the input features are randomly shuffled before they are sampled. For the following reasons, this can be resource-intensive (memory and time) if you are working with large datasets:
- All features are blocked in the Sampler until the last feature arrives.
- After the last feature arrives, all features are then shuffled, sampled, and output.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.