Integration Toolkit Solutions Wiki

Adding Columns to a Dataset where the Column Data is derived from expressions

The selectStar() expression can be used to add one or more columns to a data set. As implied by the name this expression is roughly equivilent to a SELECT * FROM Table1 query in SQL. The advantage here is that the expression iterates through each row, allowing you to derive a new columns value from other data in the table.

Obviously the data expression does not need to reference the existing data. Any valid expression which returns the correct datatype can be used.

Example Expression Single Column
selectStar(
    {path.to.originalDataset},
    asMap('New Column', 'I'),
    it()['Column 1'] + 10
)
Example Expression Multiple Columns
selectStar(
    {path.to.originalDataset},
    asMap('New Column', 'I','New Column 2','I'),
    it()['Column 1'] + 10,
    it()['Column 1'] * 10
)
Features Used
  • selectStar() Adds columns to a dataset with row-by-row computation of the contents of the new columns.
  • asMap() Creates a map of the list of key-value pairs.
  • it()['columnName'] Delivers a cell value based on the column name.