Skip to main content
Dependencies:
  • ProphecySparkBasicsScala 0.1.9+
Cluster requirements:
  • UC dedicated clusters 14.3+ supported
  • UC standard clusters 14.3+ supported
  • Livy clusters 3.0.1+ supported
The BulkColumnExpressions gem primarily lets you cast or change the data type of multiple columns at once. It provides additional functionality, including:
  • Adding a prefix or suffix to selected columns.
  • Applying a custom expression to selected columns.

Parameters

Example

Assume you have some columns in a table that represent zero-based indices and are stored as long data types. You want them to represent one-based indices and be stored as integers to optimize memory use. Using the BulkColumnExpressions gem, you can:
  • Filter your columns by long data types.
  • Select the columns you wish to transform.
  • Cast the output column(s) to be integers.
  • Include column_value + 1 in the expression field to shift the indices.

Example code

To see the compiled code of your project, switch to the Code view in the project header.