Setup Kotlin DataFrame in Kotlin Toolchain
Kotlin DataFrame can be added as a usual Kotlin Toolchain dependency to your Kotlin project.
Create a Kotlin project
In IntelliJ IDEA, select File | New | Project.
In the panel on the left, select New Project.
Name the new project and change its location, if necessary.
From the Language list, select Kotlin.
Select the Kotlin build system.
From the JDK list, select the JDK that you want to use in your project. The minimum supported version is JDK 8.
If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory.
If you don't have the necessary JDK on your computer, select Download JDK.
Select the Add sample code checkbox to create a file with a sample
"Hello World!"application.Click Create.
You have successfully created a project with Kotlin Toolchain.
Setup Kotlin DataFrame
1. Enable the plugin
Kotlin DataFrame Compiler Plugin enables automatic generation of extension properties and updates data schemas on-the-fly in Kotlin Toolchain projects, making development with Kotlin DataFrame faster, more convenient, and fully type- and name-safe.
To enable the plugin in your Kotlin Toolchain project, update the settings: block in your module.yaml:
Doing so will enable the compiler plugin matching the Kotlin version. It will also automatically add the latest (1.0.0-rc01) dataframe-core dependency to your project.
In contrast to Maven and Gradle projects, this does NOT include any IO dependencies.
2. Add IO dependencies and specify the library version
Enabling specific IO modules can be done quite easily in the dependencies: block, as DataFrame is a Kotlin Toolchain 'built-in technology'. Additionally, if you want a specific version of the DataFrame library, you can do that in the settings.kotlin.dataframe: block:
Specifying dependencies without the compiler plugin
If the compiler plugin is disabled, the $kotlin.dataframe built-in catalog won't work. In this case, specifying DataFrame dependencies will need to be done the same way as you would declare any other dependency in Kotlin Toolchain:
This will add the general Kotlin DataFrame dependency, i.e., core API and implementation as well as all IO modules (excluding experimental ones).
You can also add just the core API module and only the specific modules you need.
Hello World
Let’s create your first DataFrame — a simple "Hello, World!" style example:
Project Example
See the Kotlin Toolchain example project with the Kotlin DataFrame Compiler Plugin enabled on GitHub.
You can also download this project.
Next Steps
Once you’ve set up Kotlin DataFrame in your Kotlin Toolchain project, continue with the Quickstart Guide to learn the basics of working with Kotlin DataFrame.
Explore detailed guides and real-world examples to see how Kotlin DataFrame helps with different data tasks.
Check out various IDEA examples using Kotlin DataFrame on GitHub.
Learn more about the compiler plugin.