This scenario describes a basic Job that extracts sample data from an input flow.
Below is a capture of the input flow:
Drop the following components from the Palette onto the design workspace: tFileInputDelimited, tReservoirSampling and tFileOutputDelimited.
Connect all the components together using the Row > Main link.
Double-click tFileInputDelimited to display the Basic settings view and define the component properties.
In the File name/Stream field, browse to the file to be used as the main input.
This file provides some information about customers.
Define the row and field separators and the header and footer in the corresponding fields, if any.
Click the [...] button next to Edit schema to open a dialog box and define the input schema.
In this example, according to the input file structure, the schema is made of ten columns.
Click the [+] button and define the input columns in the dialog box as in the above figure. Click OK to close the dialog box.
If needed, right-click tFileInputDelimited and select Data Viewer to display a view of the input data.
Double-click tReservoirSampling to display the Basic settings view and define the component properties.
Click the Edit schema button to view the input and output columns and do any modifications in the output schema, if needed.
In the Sample Size field, enter a number for the rows you want to extract from the input flow, 24 in this example.
Click the Advanced settings tab and enter a random number in the Seed for random generator field.
By setting a number in this field, you will extract the same sample in each execution of the Job. Change the value if you want to extract a different sample.
Double-click tFileOutputDelimited to display its Basic settings view and define the component properties.
In the File Name field, specify the path to the file to which you want to write the sample data.
Define the row and field separators in the corresponding fields, if any.
Save your Job and press F6 to execute it.
The sample data is extracted and written to the output file.
Right-click the output component and select Data Viewer to display the extracted data.
24 records have been extracted from the input file as you defined in the tReservoirSampling component settings. The Code column indicates that data has not been extracted sequentially from the input file. Data has been extracted in a way that any profiling results on the sample data will be close to the profiling results on the full data set.