add

fun add(col: DataColumn<*>): String

Adds a column to the builder, ensuring its name is unique.

  • If a column with the same name already exists, the new column is renamed to a unique name.

  • If checkDuplicateValues is true, the method checks whether the new column has identical values to an existing column with the same name. If the values match, the column is not added.

See DynamicDataFrameBuilder on the documentation website.

Return

The final unique name assigned to the column.

Parameters

col

The column to add to the DataFrame builder.


inline fun <reified T> add(values: Iterable<T>, name: String = ""): String

Adds a column to the builder from the given iterable of values, ensuring the column's name is unique.

The method automatically converts the given iterable into a column using the specified or default name and infers the type of the column's elements.

  • If a column with the same name already exists, the new column is renamed to a unique name.

  • If the checkDuplicateValues property of the builder is true, the method checks whether the new column has identical values to an existing column with the same name. If the values match, the column is not added.

See DynamicDataFrameBuilder on the documentation website.

Return

The final unique name assigned to the column.

Parameters

values

The iterable collection of values to be added as a new column.

name

The name of the new column. If empty, a unique name will be generated automatically.

Type Parameters

T

The inferred type of the elements in the column.