tree: 31e069f1316d3eb9c3692ccc5f2d0ab663ea913e
  1. datafusion-ffi-example/
  2. tpch/
  3. array-operations.py
  4. chart.png
  5. create-context.py
  6. csv-read-options.py
  7. dataframe-parquet.py
  8. distributed-localhost-worker.py
  9. distributed-run.py
  10. export.py
  11. import.py
  12. multiprocessing_pickle_expr.py
  13. python-udaf.py
  14. python-udf-comparisons.py
  15. python-udf.py
  16. python-udwf.py
  17. query-pyarrow-data.py
  18. ray_pickle_expr.py
  19. README.md
  20. sql-parquet-s3.py
  21. sql-parquet.py
  22. sql-to-pandas.py
  23. sql-using-python-udaf.py
  24. sql-using-python-udf.py
  25. substrait.py
examples/README.md

DataFusion Python Examples

Some examples rely on data which can be downloaded from the following site:

Here is a direct link to the file used in the examples:

Creating a SessionContext

Executing Queries with DataFusion

Running User-Defined Python Code

Distributing DataFusion expressions

Distributed Query Execution

Example:

curl -LO https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2021-01.parquet
python examples/distributed-localhost-worker.py 50051
python examples/distributed-localhost-worker.py 50052
WORKERS=50051,50052 python examples/distributed-run.py --plan yellow_tripdata_2021-01.parquet

Substrait Support

Executing SQL against DataFrame Libraries (Experimental)

TPC-H Examples

Within the subdirectory tpch there are 22 examples that reproduce queries in the TPC-H specification. These include realistic data that can be generated at arbitrary scale and allow the user to see use cases for a variety of data frame operations.

In the list below we describe which new operations can be found in the examples. The queries are designed to be of increasing complexity, so it is recommended to review them in order. For brevity, the following list does not include operations found in previous examples.