Skip to main content

DB_Column.map

mapfunctionskip_nothingexpected_value_type

Aliases: transform column

Documentation

Applies function to each item in this column and returns the column of results.

Arguments

  • function: The function to apply to each element of self column.
  • skip_nothing: If True, Nothing values will be skipped. Otherwise, Nothing values will be passed to the function.
  • expected_value_type: The expected value type of the resulting column. If Auto, the value type will be inferred from the values returned by function.

Examples

Multiply each element of the column by itself.

      import Standard.Examples

example_map = Examples.integer_column.map (x -> x * x)

Errors

  • If any of the values returned by function do not fit the expected value type, an Invalid_Value_Type error is raised.
  • If the function raises a dataflow error on any row, the first such error is propagated.
  • If an invocation of the function returns a value with warnings, these warnings are attached to the overall result.