Description
The ORCToMapGen Generator reads data from one or more columns within a specified ORC file and saves it to memory. Once the data is in memory, the ORCFromMapGen Generator is used to get the data from a particular column by Column Name for each Attribute.
In This Article
- ORCToMapGen Parameters
- ORCFromMapGen Parameters
- Preview Showing Empty Values - List Parameter
- Use Case Example
ORCToMapGen Parameters
The following parameters may be configured for the ORCToMapGen Generator. Items with an asterisk* are required.
- path* - Defines the path where the ORC file is located.
- subDir - Defines an optional subdirectory under the resourcePath where the ORC file exists.
- fileName* - Defines the name of the ORC file located on the user's system.
- columnNames - Defines the list of columns to read the data from.
- bufferSize* - Defines how many rows to keep in memory from the ORC file to avoid the "out of memory" exception.
- setLoop* - Provides the ability to OVERRIDE the loop count at the Scenario level and ONLY produce the number of rows defined in this list. This does not apply to GenRocket Express, as it does not use Scenarios.
- list - Stores one value on each line in the list. To enter values, type them in and hit ENTER. Note that the listed value shown is only for simulation mode. When running a true Scenario, the data will be loaded from the specified resource.
ORCFromMapGen Parameters
The following parameters may be configured for the ORCFromMapGen Generator. Items with an asterisk* are required.
columnName* - The name of the column within the ORC file that data was read from.
- list - Stores one value on each line in the list. To enter values, type them in and hit ENTER. Note that the listed value shown is only for simulation mode. When running a true Scenario, the data will be loaded from the specified resource.
Preview Showing Empty Values - List Parameter
The ORCToMapGen Generator reads the column data from the given ORC file and saves the values to memory. The ORCFromMapGen Generator then obtains that column data. Both actions are performed while running the Scenario on the user's system locally.
The list parameter can be used to simulate data displayed in the Preview pane for one or both Generators on the GenRocket web app.
If no values are entered for the list parameter, the preview will show Empty values for each record.
Use Case Example
A tester wants to read specific values from an ORC file and then map them to particular Attributes within a Domain. This can be done using the ORCToMapGen and ORCFromMapGen Generators.
The ORC file contains three values that need to be read and mapped to these Attributes:
- product name
- product description
- product price
Project Setup
The tester has created a Product Domain that contains five Attributes: id, product, productName, productDescription, and productPrice.
A DelimitedFileReceiver has been added to the Domain to see the output in delimited format.
A Scenario has also been created for the Domain:
The product Domain loopCount has been set to '10' and will generate ten records.
productDetails Attribute
The productDetails Attribute reads the three columns into memory. The Attribute has been marked as hidden and will not appear in the generated output. It will read the values from the file into memory for other Attributes to map from.
ORCToMapGen Generator
The ORCToMapGen Generator has been assigned to the productDetails Attribute. It will read these values from the productName, productDescription, and productPrice columns within SampleORCFile.orc into memory.
ORCFromMapGen Generator
The ORCFromMapGen Generator has been assigned to three Attributes: productName, productDescription, and productPrice.
productName Attribute
productDescription Attribute
productPrice Attribute
Sample Output
For this example, the data has been read from an ORC file and then generated in delimited output format: