parse
Returns a DataFrame
in which the given String
columns are parsed into other types.
This is a special case of the convert operation.
To parse only particular columns use a column selector:
parse
tries to parse every String
column into one of supported types in the following order:
Int
Long
Instant
(kotlinx.datetime
andjava.time
)LocalDateTime
(kotlinx.datetime
andjava.time
)LocalDate
(kotlinx.datetime
andjava.time
)Duration
(kotlin.time
andjava.time
)LocalTime
(java.time
)URL
(java.net
)Double
(with optional locale settings)Boolean
BigDecimal
JSON
(arrays and objects)
Available parser options:
locale: Locale
is used to parse doublesdateTimePattern: String
is used to parse date and timedateTimeFormatter: DateTimeFormatter
is used to parse date and timenullStrings: List<String>
is used to treat particular strings asnull
value. Default null strings are "null" and "NULL"
You can also set global parser options that will be used by default in read
, convert
, and parse
operations: