Similar to replace with operation, columns can be converted in a compiler-plugin-friendly fashion whenever you need to perform an operation on the entire column without changing its name. For example, parallel reading.
df.convert { name }.asColumn { col ->
col.toList().parallelStream().map { it.toString() }.collect(Collectors.toList()).toColumn()
}
df.convert {}.to<>() and col.convertTo<>() support automatic type conversions between the following types:
String, Char (uses parse to convert from String to other types)
Boolean
Byte
Short
Int (and Char)
Long
Float
Double (See parsing doubles for String to Double conversion)
BigDecimal (java.math)
BigInteger (java.math)
LocalDateTime (kotlinx.datetime and java.time)
LocalDate (kotlinx.datetime and java.time)
LocalTime (kotlinx.datetime and java.time)
Instant (kotlinx.datetime, kotlin.time, and java.time)
Duration (kotlin.time, and java.time, to/from Long, Int, String, and each other)
DateTimeComponents (kotlinx.datetime, to any other kotlinx-datetime/java.time type, Instant, or Long)