parse

Edit page Last modified: 14 January 2025

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 and java.time)

  • LocalDateTime (kotlinx.datetime and java.time)

  • LocalDate (kotlinx.datetime and java.time)

  • Duration (kotlin.time and java.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 doubles

  • dateTimePattern: String is used to parse date and time

  • dateTimeFormatter: DateTimeFormatter is used to parse date and time

  • nullStrings: List<String> is used to treat particular strings as null 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: