Data Schemas

Edit pageLast modified: 24 July 2025

The Kotlin DataFrame library provides typed data access via generation of extension properties for the type DataFrame<T> (as well as for DataRow<T>), where T is a marker class representing the DataSchema of the DataFrame.

A schema of a DataFrame is a mapping from column names to column types.
This data schema can be expressed as a Kotlin class or interface.
If the DataFrame is hierarchical — contains a column group or a column of dataframes — the data schema reflects this structure, with a separate class representing the schema of each column group or nested DataFrame.

For example, consider a simple hierarchical DataFrame from example.csv.

This DataFrame consists of two columns:

  • name, which is a String column

  • info, which is a column group containing two nested value columns:

    • age of type Int

    • height of type Double

The data schema corresponding to this DataFrame can be represented as:

Extension properties for DataFrame<Person>
are generated based on this schema and allow accessing columns or using them in operations:

See Extension Properties API for more information.