Skip to main content
Version: Java (Groovy)

renameColumns

The renameColumns method creates a new table with the specified columns renamed.

Syntax

table.renameColumns(pairs)

Parameters

ParameterTypeDescription
pairsCollection<Pair>

The column rename expressions, e.g., "X = Y".

Returns

A new table with the specified columns renamed.

Examples

source = newTable(
stringCol("A", "Some", "string", "values", "here"),
intCol("B", 1, 2, 3, 4),
stringCol("C", "more", "strings", "over", "here"),
)

result = source.renameColumns("X = A", "Y = B", "Z = C")