Skip to content

Apache DataFusion SQL Query Engine

Improve getting started guide, add note about compatible `arrow` versions (#6472)

Andrew Lamb8336a5823ccc
diff --git a/README.md b/README.md
index 73060f3684..df3546d007 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@
[![Coverage Status](https://codecov.io/gh/apache/arrow-datafusion/rust/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/arrow-datafusion?branch=master)
-<img src="docs/source/_static/images/DataFusion-Logo-Background-White.svg" width="256" alt="logo"/>
+<img src="https://arrow.apache.org/datafusion/_images/DataFusion-Logo-Background-White.png" width="256" alt="logo"/>
DataFusion is a very fast, extensible query engine for building high-quality data-centric systems in
[Rust](http://rustlang.org), using the [Apache Arrow](https://arrow.apache.org)
@@ -29,12 +29,16 @@ in-memory format.
DataFusion offers SQL and Dataframe APIs, excellent [performance](https://benchmark.clickhouse.com/), built-in support for CSV, Parquet, JSON, and Avro, extensive customization, and a great community.
-See the Project Website at https://arrow.apache.org/datafusion/ for more details.
+https://arrow.apache.org/datafusion/ contains the project's documentation.
-## Getting Started
+## Using DataFusion
-Please see the [developer’s guide](https://arrow.apache.org/datafusion/contributor-guide/index.html#developer-s-guide) for more information on how to get started.
+The [example usage] section in the user guide and the [datafusion-examples] code in the crate contain information on using DataFusion.
-## Examples
+## Contributing to DataFusion
-Please see the [example usage](https://arrow.apache.org/datafusion/user-guide/example-usage.html) in the user guide and the [datafusion-examples](https://github.com/apache/arrow-datafusion/tree/master/datafusion-examples) crate for more information on how to use DataFusion.
+The [developer’s guide] contains information on how to contribute.
+
+[example usage]: https://arrow.apache.org/datafusion/user-guide/example-usage.html
+[datafusion-examples]: https://github.com/apache/arrow-datafusion/tree/master/datafusion-examples
+[developer’s guide]: https://arrow.apache.org/datafusion/contributor-guide/index.html#developer-s-guide
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 83c517faf0..4f45771173 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -31,6 +31,13 @@ DataFusion offers SQL and Dataframe APIs, excellent
CSV, Parquet, JSON, and Avro, extensive customization, and a great
community.
+The `example usage`_ section in the user guide and the `datafusion-examples`_ code in the crate contain information on using DataFusion.
+
+The `developer’s guide`_ contains information on how to contribute.
+
+.. _example usage: user-guide/example-usage.html
+.. _datafusion-examples: https://github.com/apache/arrow-datafusion/tree/master/datafusion-examples
+.. _developer’s guide: contributor-guide/index.html#developer-s-guide
.. _toc.links:
.. toctree::
diff --git a/docs/source/user-guide/example-usage.md b/docs/source/user-guide/example-usage.md
index 2bbbe8e38f..69eeb90286 100644
--- a/docs/source/user-guide/example-usage.md
+++ b/docs/source/user-guide/example-usage.md
@@ -81,6 +81,37 @@ async fn main() -> datafusion::error::Result<()> {
+---+--------+
```
+## Arrow Versions
+
+Many of DataFusion's public APIs use types from the
+[`arrow`] and [`parquet`] crates, so if you use
+`arrow` in your project, the `arrow` version must match that used by
+DataFusion. You can check the required version on [DataFusion's
+crates.io] page.
+
+The easiest way to ensure the versions match is to use the `arrow`
+exported by DataFusion, for example:
+
+```rust
+use datafusion::arrow::datatypes::Schema;
+```
+
+For example, [DataFusion `25.0.0` dependencies] require `arrow`
+`39.0.0`. If instead you used `arrow` `40.0.0` in your project you may
+see errors such as:
+
+```text
+mismatched types [E0308] expected `Schema`, found `arrow_schema::Schema` Note: `arrow_schema::Schema` and `Schema` have similar names, but are actually distinct types Note: `arrow_schema::Schema` is defined in crate `arrow_schema` Note: `Schema` is defined in crate `arrow_schema` Note: perhaps two different versions of crate `arrow_schema` are being used? Note: associated function defined here
+```
+
+Or calling `downcast_ref` on an `ArrayRef` may return `None`
+unexpectedly.
+
+[`arrow`]: https://docs.rs/arrow/latest/arrow/
+[`parquet`]: https://docs.rs/parquet/latest/parquet/
+[datafusion's crates.io]: https://crates.io/crates/datafusion
+[datafusion `25.0.0` dependencies]: https://crates.io/crates/datafusion/25.0.0/dependencies
+
## Identifiers and Capitalization
Please be aware that all identifiers are effectively made lower-case in SQL, so if your csv file has capital letters (ex: `Name`) you must put your column name in double quotes or the examples won't work.