When to use a functional map

The use of functional maps is very common. Almost every executable map created will use at least one functional map.

To map a group in the input to a different group in the output, use a functional map.

For example, use a functional map to map an input row to an output row when the rows are defined differently. Or, use a functional map to map from a file containing many input rows, to generate a file of many output rows with one output row per input row. The first output row would correspond to the first input row, the second output row corresponds to the second input row, and so on.

A map defines how to generate the output data. One important factor to consider in determining when to use a functional map is the presence of an output component with a range of more than one. For example, ranges of (s) or (1:10). The number of this output object to be created is based on the number of some input object.

Another important factor in determining when to use a functional map is when you want to transform the data - mapping from one or more types to a different type. In the preceding example of the functional map that maps one Message to one row in a database table, the input row and the output row are two different types.

Use a functional map when the number of a certain output group that you want to create is based on the occurrences of some input or output data - and the types are different types.