Development Environment

This section describes how you can get started at developing DataFusion.

Windows setup

wget https://az792536.vo.msecnd.net/vms/VMBuild_20190311/VirtualBox/MSEdge/MSEdge.Win10.VirtualBox.zip
choco install -y git rustup.install visualcpp-build-tools
git-bash.exe
cargo build

Dev Container setup

DataFusion has support for dev containers which may be used for developing DataFusion in an isolated environment either locally or remote if desired. Using dev containers for developing DataFusion is not a requirement by any means but is available for those where doing local development could be tricky such as with Windows and WSL2, those with older hardware, etc.

For specific details on IDE support for dev containers see the documentation for Visual Studio Code, IntelliJ IDEA, Rust Rover, and GitHub Codespaces.

Protoc Installation

Compiling DataFusion from sources requires an installed version of the protobuf compiler, protoc.

On most platforms this can be installed from your system’s package manager

# Ubuntu
$ sudo apt install -y protobuf-compiler

# Fedora
$ dnf install -y protobuf-devel

# Arch Linux
$ pacman -S protobuf

# macOS
$ brew install protobuf

You will want to verify the version installed is 3.15 or greater, which has support for explicit field presence. Older versions may fail to compile.

$ protoc --version
libprotoc 3.15.0

Alternatively a binary release can be downloaded from the Release Page or built from source.

Bootstrap environment

DataFusion is written in Rust and it uses a standard rust toolkit:

  • rustup update stable DataFusion generally uses the latest stable release of Rust, though it may lag when new Rust toolchains release

    • See which toolchain is currently pinned in the rust-toolchain.toml file

    • This can cause issues such as not having the rust-analyzer component installed for the specified toolchain, in which case just install it manually, e.g. rustup component add --toolchain 1.88 rust-analyzer

  • cargo build

  • cargo fmt to format the code

  • etc.

Testing setup:

  • git submodule init

  • git submodule update --init --remote --recursive

  • cargo test to run tests

Note that running cargo test requires significant memory resources, due to cargo running many tests in parallel by default. If you run into issues with slow tests or system lock ups, you can significantly reduce the memory required by instead running cargo test -- --test-threads=1. For more information see this issue.

Formatting instructions:

or run them all at once: