Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 2.21 KB

File metadata and controls

70 lines (51 loc) · 2.21 KB
jupytext
text_representation
extension format_name
.md
myst
kernelspec
name display_name
python3
Python 3

DataFusion in Python

This is a Python library that binds to Apache Arrow in-memory query engine DataFusion.

Like pyspark, it allows you to build a plan through SQL or a DataFrame API against in-memory data, parquet or CSV files, run it in a multi-threaded environment, and obtain the result back in Python.

It also allows you to use UDFs and UDAFs for complex operations.

The major advantage of this library over other execution engines is that this library achieves zero-copy between Python and its execution engine: there is no cost in using UDFs, UDAFs, and collecting the results to Python apart from having to lock the GIL when running those operations.

Its query engine, DataFusion, is written in Rust, which makes strong assumptions about thread safety and lack of memory leaks.

Technically, zero-copy is achieved via the c data interface.

Install

pip install datafusion

Example

from datafusion import SessionContext

ctx = SessionContext()

df = ctx.read_csv("pokemon.csv")

df.show()

:hidden: true
:maxdepth: 1

user-guide/index
contributor-guide/index
API Reference <autoapi/index>
links