Convert

class Convert<T, out C>(val df: DataFrame<T>, val columns: ColumnsSelector<T, C>)

An intermediate class used in the convert operation.

This class itself does not perform any conversion — it is a transitional step before specifying how to convert the selected columns. It must be followed by one of the conversion methods to produce a new DataFrame with updated column values and types.

The resulting columns will keep their original names and positions in the DataFrame, but their values will be transformed.

Use the following methods to perform the conversion:

See Grammar for more details.

See convert on the documentation website.

Constructors

Link copied to clipboard
constructor(df: DataFrame<T>, columns: ColumnsSelector<T, C>)

Properties

Link copied to clipboard
Link copied to clipboard
internal val df: DataFrame<T>

Functions

Link copied to clipboard
inline fun <T, C, R> Convert<T, C>.asColumn(crossinline columnConverter: DataFrame<T>.(DataColumn<C>) -> BaseColumn<R>): DataFrame<T>

Converts values in the columns previously selected with convert using columnConverter expression within the DataFrame.

Link copied to clipboard

Converts column groups previously selected with convert as a DataFrame using a dataframe expression.

Link copied to clipboard
fun <R> cast(): Convert<T, R>

Casts the type parameter of the columns previously selected with convert to a new type R, without performing any actual data transformation.

Link copied to clipboard
internal fun <T, C, R> Convert<T, C>.convertRowColumnImpl(type: KType, infer: Infer, rowConverter: RowColumnExpression<T, C, R>): DataFrame<T>
Link copied to clipboard
inline fun <T, C, reified R> Convert<T, C?>.notNull(crossinline expression: RowValueExpression<T, C, R>): DataFrame<T>
Link copied to clipboard
inline fun <T, C, reified R> Convert<T, C>.perRowCol(infer: Infer = Infer.Nulls, noinline expression: RowColumnExpression<T, C, R>): DataFrame<T>

Converts values in the columns previously selected with convert using row column expression within the DataFrame.

Link copied to clipboard
internal inline fun <T, C, R> Convert<T, C?>.splitInplace(type: KType, crossinline transform: DataRow<T>.(C) -> Iterable<R>): DataFrame<T>
Link copied to clipboard
inline fun <reified D> to(parserOptions: ParserOptions? = null): DataFrame<T>

Converts the values in the columns previously selected with convert to the specified type, preserving their original names and positions within the DataFrame.

Link copied to clipboard
fun <T, C> Convert<T, C>.to(columnConverter: DataFrame<T>.(DataColumn<C>) -> BaseColumn<*>): DataFrame<T>

fun <T> Convert<T, *>.to(type: KType, parserOptions: ParserOptions? = null): DataFrame<T>

Converts the values in the columns previously selected with convert to the specified type, preserving their original names and positions within the DataFrame.

Link copied to clipboard

Converts values in the columns previously selected with convert to BigDecimal, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to BigInteger, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to Boolean, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
fun <T, C> Convert<T, List<List<C>>>.toDataFrames(containsColumns: Boolean = false): DataFrame<T>

Converts a list of lists values in the columns previously selected with convert to DataFrame, preserving their original names and positions within the DataFrame.

Link copied to clipboard

Converts values in the columns previously selected with convert to DateTimeComponents, preserving their original names and positions within the DataFrame.

@FormatStringsInDatetimeFormats
fun <T> Convert<T, String?>.toDateTimeComponents(pattern: String): DataFrame<T>
fun <T> Convert<T, String?>.toDateTimeComponents(format: DateTimeFormat<DateTimeComponents>? = null): DataFrame<T>

Converts values in the String columns previously selected with convert to DateTimeComponents, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the String columns previously selected with convert to kotlinx.datetime.Instant, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to Double, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to Duration, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to Float, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
fun <T> Convert<T, URL?>.toIFrame(border: Boolean = false, width: Int? = null, height: Int? = null): DataFrame<T>

Converts values in the URL columns previously selected with convert to IFRAME, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
fun <T> Convert<T, URL?>.toImg(width: Int? = null, height: Int? = null): DataFrame<T>

Converts values in the URL columns previously selected with convert to IMG, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Deprecated:

Link copied to clipboard
fun <T> Convert<T, Any?>.toInt(): DataFrame<T>

Converts values in the columns previously selected with convert to Int, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to JavaDuration, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to JavaInstant, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to JavaLocalDate, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toJavaLocalDateFromStringNullable")
fun <T> Convert<T, String?>.toJavaLocalDate(formatter: DateTimeFormatter? = null, locale: Locale? = null): DataFrame<T>
@JvmName(name = "toJavaLocalDateFromStringNullablePattern")
fun <T> Convert<T, String?>.toJavaLocalDate(pattern: String, locale: Locale? = null): DataFrame<T>

Converts values in the nullable String columns previously selected with convert to JavaLocalDate, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toJavaLocalDateFromString")
fun <T> Convert<T, String>.toJavaLocalDate(formatter: DateTimeFormatter? = null, locale: Locale? = null): DataFrame<T>
@JvmName(name = "toJavaLocalDateFromStringPattern")
fun <T> Convert<T, String>.toJavaLocalDate(pattern: String, locale: Locale? = null): DataFrame<T>

Converts values in the String columns previously selected with convert to JavaLocalDate, preserving their original names and positions within the DataFrame.

Link copied to clipboard

Converts values in the columns previously selected with convert to JavaLocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

fun <T> Convert<T, String?>.toJavaLocalDateTime(formatter: DateTimeFormatter? = null, locale: Locale? = null): DataFrame<T>
fun <T> Convert<T, String?>.toJavaLocalDateTime(pattern: String, locale: Locale? = null): DataFrame<T>

Converts values in the nullable String columns previously selected with convert to JavaLocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard

Converts values in the columns previously selected with convert to JavaLocalTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toJavaLocalTimeFromStringNullable")
fun <T> Convert<T, String?>.toJavaLocalTime(formatter: DateTimeFormatter? = null, locale: Locale? = null): DataFrame<T>
@JvmName(name = "toJavaLocalTimeFromStringNullablePattern")
fun <T> Convert<T, String?>.toJavaLocalTime(pattern: String, locale: Locale? = null): DataFrame<T>

Converts values in the nullable String columns previously selected with convert to JavaLocalTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toJavaLocalTimeFromString")
fun <T> Convert<T, String>.toJavaLocalTime(formatter: DateTimeFormatter? = null, locale: Locale? = null): DataFrame<T>
@JvmName(name = "toJavaLocalTimeFromStringPattern")
fun <T> Convert<T, String>.toJavaLocalTime(pattern: String, locale: Locale? = null): DataFrame<T>

Converts values in the String columns previously selected with convert to JavaLocalTime, preserving their original names and positions within the DataFrame.

Link copied to clipboard

Converts values in the columns previously selected with convert to LocalDate, preserving their original names and positions within the DataFrame.

@JvmName(name = "toLocalDateFromDateTimeComponents")
fun <T> Convert<T, DateTimeComponents?>.toLocalDate(): DataFrame<T>

Converts values in the DateTimeComponents columns previously selected with convert to LocalDate, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalDateFromTInt")
fun <T> Convert<T, Int?>.toLocalDate(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the Int columns previously selected with convert to LocalDate, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalDateFromTLong")
fun <T> Convert<T, Long?>.toLocalDate(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the Long columns previously selected with convert to LocalDate, preserving their original names and positions within the DataFrame. Preserves null values.

@FormatStringsInDatetimeFormats
fun <T> Convert<T, String?>.toLocalDate(pattern: String): DataFrame<T>
fun <T> Convert<T, String?>.toLocalDate(format: DateTimeFormat<LocalDate>? = null): DataFrame<T>

Converts values in the String columns previously selected with convert to LocalDate, preserving their original names and positions within the DataFrame. Preserves null values.

fun <T> Convert<T, String?>.toLocalDate(pattern: String? = null, locale: Locale?): DataFrame<T>
Link copied to clipboard

Converts values in the columns previously selected with convert to LocalDateTime, preserving their original names and positions within the DataFrame.

@JvmName(name = "toLocalDateTimeFromDateTimeComponents")
fun <T> Convert<T, DateTimeComponents?>.toLocalDateTime(): DataFrame<T>

Converts values in the DateTimeComponents columns previously selected with convert to LocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalDateTimeFromTInt")
fun <T> Convert<T, Int?>.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the Int columns previously selected with convert to LocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalDateTimeFromTLong")
fun <T> Convert<T, Long?>.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the Long columns previously selected with convert to LocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

@FormatStringsInDatetimeFormats
fun <T> Convert<T, String?>.toLocalDateTime(pattern: String): DataFrame<T>
fun <T> Convert<T, String?>.toLocalDateTime(format: DateTimeFormat<LocalDateTime>? = null): DataFrame<T>

Converts values in the String columns previously selected with convert to LocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalDateTimeFromTStdlibInstant")
fun <T> Convert<T, Instant?>.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the kotlin.time.Instant columns previously selected with convert to LocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalDateTimeFromTDeprecatedInstant")
fun <T> Convert<T, Instant?>.toLocalDateTime(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the kotlinx.datetime.Instant columns previously selected with convert to LocalDateTime, preserving their original names and positions within the DataFrame. Preserves null values.

fun <T> Convert<T, String?>.toLocalDateTime(pattern: String? = null, locale: Locale?): DataFrame<T>
Link copied to clipboard

Converts values in the columns previously selected with convert to LocalTime, preserving their original names and positions within the DataFrame.

@JvmName(name = "toLocalTimeFromDateTimeComponents")
fun <T> Convert<T, DateTimeComponents?>.toLocalTime(): DataFrame<T>

Converts values in the DateTimeComponents columns previously selected with convert to LocalTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalTimeFromTInt")
fun <T> Convert<T, Int?>.toLocalTime(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the Int columns previously selected with convert to LocalTime, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toLocalTimeFromTLong")
fun <T> Convert<T, Long?>.toLocalTime(zone: TimeZone = defaultTimeZone): DataFrame<T>

Converts values in the Long columns previously selected with convert to LocalTime, preserving their original names and positions within the DataFrame. Preserves null values.

@FormatStringsInDatetimeFormats
fun <T> Convert<T, String?>.toLocalTime(pattern: String): DataFrame<T>
fun <T> Convert<T, String?>.toLocalTime(format: DateTimeFormat<LocalTime>? = null): DataFrame<T>

Converts values in the String columns previously selected with convert to LocalTime, preserving their original names and positions within the DataFrame. Preserves null values.

fun <T> Convert<T, String?>.toLocalTime(pattern: String? = null, locale: Locale?): DataFrame<T>
Link copied to clipboard
fun <T> Convert<T, Any?>.toLong(): DataFrame<T>

Converts values in the columns previously selected with convert to Long, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
@JvmName(name = "toStdlibInstantFromString")
fun <T> Convert<T, String?>.toStdlibInstant(): DataFrame<T>

Converts values in the String columns previously selected with convert to kotlin.time.Instant, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toStdlibInstantFromDeprecatedInstant")
fun <T> Convert<T, Instant?>.toStdlibInstant(): DataFrame<T>

Converts values in the kotlinx.datetime.Instant columns previously selected with convert to kotlin.time.Instant, preserving their original names and positions within the DataFrame. Preserves null values.

@JvmName(name = "toStdlibInstantFromDateTimeComponents")
fun <T> Convert<T, DateTimeComponents?>.toStdlibInstant(): DataFrame<T>

Converts values in the DateTimeComponents columns previously selected with convert to kotlin.time.Instant, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
fun <T> Convert<T, Any?>.toStr(): DataFrame<T>

Converts values in the columns previously selected with convert to String, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Converts values in the String columns previously selected with convert to an URL, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
fun <T> Convert<T, DateTimeComponents?>.toUtcOffset(): DataFrame<T>

Converts values in the DateTimeComponents columns previously selected with convert to UtcOffset, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
fun <T> Convert<T, DateTimeComponents?>.toYearMonth(): DataFrame<T>

Converts values in the DateTimeComponents columns previously selected with convert to YearMonth, preserving their original names and positions within the DataFrame. Preserves null values.

Link copied to clipboard
inline fun <T, C, reified R> Convert<T, C>.with(infer: Infer = Infer.Nulls, noinline rowConverter: RowValueExpression<T, C, R>): DataFrame<T>

Converts values in columns previously selected by convert using the specified rowConverter, a row value expression applied to each row in the DataFrame.

Link copied to clipboard
internal fun <T, C, R> Convert<T, C>.withRowCellImpl(type: KType, infer: Infer, rowConverter: RowValueExpression<T, C, R>): DataFrame<T>