Skip to content

Apache DataFusion SQL Query Engine

Improve DataFusion subcrate readme files (#16263)

Andrew Lamb367331e4a834
diff --git a/datafusion/catalog-listing/README.md b/datafusion/catalog-listing/README.md
index b4760c413d..c8d1cf13b4 100644
--- a/datafusion/catalog-listing/README.md
+++ b/datafusion/catalog-listing/README.md
@@ -25,6 +25,12 @@ This crate is a submodule of DataFusion with [ListingTable], an implementation
of [TableProvider] based on files in a directory (either locally or on remote
object storage such as S3).
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
[df]: https://crates.io/crates/datafusion
[listingtable]: https://docs.rs/datafusion/latest/datafusion/datasource/listing/struct.ListingTable.html
[tableprovider]: https://docs.rs/datafusion/latest/datafusion/datasource/trait.TableProvider.html
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/catalog/README.md b/datafusion/catalog/README.md
index 5b201e736f..d4870e28f3 100644
--- a/datafusion/catalog/README.md
+++ b/datafusion/catalog/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that provides catalog management functionality, including catalogs, schemas, and tables.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/common-runtime/README.md b/datafusion/common-runtime/README.md
index 77100e5260..bd0d4954b8 100644
--- a/datafusion/common-runtime/README.md
+++ b/datafusion/common-runtime/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that provides common utilities.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/common/README.md b/datafusion/common/README.md
index 524ab4420d..e4d6b77265 100644
--- a/datafusion/common/README.md
+++ b/datafusion/common/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that provides common data types and utilities.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/datasource-avro/README.md b/datafusion/datasource-avro/README.md
index f8d7aebdca..3436d4a85a 100644
--- a/datafusion/datasource-avro/README.md
+++ b/datafusion/datasource-avro/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that defines a Avro based file source.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/datasource-csv/README.md b/datafusion/datasource-csv/README.md
index c5944f9e43..0ebddb5386 100644
--- a/datafusion/datasource-csv/README.md
+++ b/datafusion/datasource-csv/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that defines a CSV based file source.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/datasource-json/README.md b/datafusion/datasource-json/README.md
index 6418181473..ac0b73b78e 100644
--- a/datafusion/datasource-json/README.md
+++ b/datafusion/datasource-json/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that defines a JSON based file source.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/datasource-parquet/README.md b/datafusion/datasource-parquet/README.md
index abcdd5ab13..9ac472a9f4 100644
--- a/datafusion/datasource-parquet/README.md
+++ b/datafusion/datasource-parquet/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that defines a Parquet based file source.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/datasource/README.md b/datafusion/datasource/README.md
index 750ee93751..5d743bc830 100644
--- a/datafusion/datasource/README.md
+++ b/datafusion/datasource/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that defines common DataSource related components like FileScanConfig, FileCompression etc.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/doc/README.md b/datafusion/doc/README.md
new file mode 100644
index 0000000000..c81a8e78c6
--- /dev/null
+++ b/datafusion/doc/README.md
@@ -0,0 +1,32 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# DataFusion Execution
+
+[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
+
+This crate is a submodule of DataFusion that provides structures and macros
+for documenting user defined functions.
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/execution/README.md b/datafusion/execution/README.md
index 8a03255ee4..dd82e206e6 100644
--- a/datafusion/execution/README.md
+++ b/datafusion/execution/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that provides execution runtime such as the memory pools and disk manager.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/expr-common/README.md b/datafusion/expr-common/README.md
new file mode 100644
index 0000000000..5f95627ca0
--- /dev/null
+++ b/datafusion/expr-common/README.md
@@ -0,0 +1,31 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# DataFusion Logical Plan and Expressions
+
+[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
+
+This crate is a submodule of DataFusion that provides common logical expressions
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/expr/README.md b/datafusion/expr/README.md
index b086f930e8..860c36769e 100644
--- a/datafusion/expr/README.md
+++ b/datafusion/expr/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that provides data types and utilities for logical plans and expressions.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/functions-aggregate-common/README.md b/datafusion/functions-aggregate-common/README.md
new file mode 100644
index 0000000000..61a81e8085
--- /dev/null
+++ b/datafusion/functions-aggregate-common/README.md
@@ -0,0 +1,31 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# DataFusion Aggregate Function Library
+
+[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
+
+This crate contains common functionality for implementation aggregate and window functions.
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/functions-aggregate/README.md b/datafusion/functions-aggregate/README.md
index 29b313d2a9..244112d4fd 100644
--- a/datafusion/functions-aggregate/README.md
+++ b/datafusion/functions-aggregate/README.md
@@ -21,7 +21,11 @@
[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
-This crate contains packages of function that can be used to customize the
-functionality of DataFusion.
+This crate contains implementations of aggregate functions.
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/functions-nested/README.md b/datafusion/functions-nested/README.md
index 8a5047c838..0fa93619b9 100644
--- a/datafusion/functions-nested/README.md
+++ b/datafusion/functions-nested/README.md
@@ -24,4 +24,9 @@
This crate contains functions for working with arrays, maps and structs, such as `array_append` that work with
`ListArray`, `LargeListArray` and `FixedListArray` types from the `arrow` crate.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/functions-table/README.md b/datafusion/functions-table/README.md
index c4e7a5aff9..485abe560d 100644
--- a/datafusion/functions-table/README.md
+++ b/datafusion/functions-table/README.md
@@ -23,4 +23,9 @@
This crate contains table functions that can be used in DataFusion queries.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/functions-window-common/README.md b/datafusion/functions-window-common/README.md
index de12d25f97..9f64c9dc82 100644
--- a/datafusion/functions-window-common/README.md
+++ b/datafusion/functions-window-common/README.md
@@ -21,6 +21,11 @@
[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
-This crate contains common functions for implementing user-defined window functions.
+This crate contains common functions for implementing window functions.
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/functions-window/README.md b/datafusion/functions-window/README.md
index 18590983ca..746d625b4f 100644
--- a/datafusion/functions-window/README.md
+++ b/datafusion/functions-window/README.md
@@ -21,6 +21,11 @@
[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
-This crate contains user-defined window functions.
+This crate contains window function definitions.
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/functions/README.md b/datafusion/functions/README.md
index a610d135c0..27dc4afc76 100644
--- a/datafusion/functions/README.md
+++ b/datafusion/functions/README.md
@@ -24,4 +24,9 @@
This crate contains packages of function that can be used to customize the
functionality of DataFusion.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/macros/README.md b/datafusion/macros/README.md
new file mode 100644
index 0000000000..c78c02f1ca
--- /dev/null
+++ b/datafusion/macros/README.md
@@ -0,0 +1,31 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+# DataFusion Window Function Common Library
+
+[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
+
+This crate contains common macros used in DataFusion
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/optimizer/README.md b/datafusion/optimizer/README.md
index 61bc1cd701..1c9b37e09f 100644
--- a/datafusion/optimizer/README.md
+++ b/datafusion/optimizer/README.md
@@ -17,6 +17,15 @@
under the License.
-->
-Please see [Query Optimizer] in the Library User Guide
+[DataFusion][df] is an extensible query execution framework, written in Rust, that uses Apache Arrow as its in-memory format.
+This crate contains the DataFusion logical optimizer.
+Please see [Query Optimizer] in the Library User Guide for more information.
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
[query optimizer]: https://datafusion.apache.org/library-user-guide/query-optimizer.html
diff --git a/datafusion/physical-expr-common/README.md b/datafusion/physical-expr-common/README.md
index 7a1eff77d3..fab03fb497 100644
--- a/datafusion/physical-expr-common/README.md
+++ b/datafusion/physical-expr-common/README.md
@@ -24,4 +24,9 @@
This crate is a submodule of DataFusion that provides shared APIs for implementing
physical expressions such as `PhysicalExpr` and `PhysicalSortExpr`.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/physical-expr/README.md b/datafusion/physical-expr/README.md
index 424256c77e..b99f3c4946 100644
--- a/datafusion/physical-expr/README.md
+++ b/datafusion/physical-expr/README.md
@@ -23,4 +23,9 @@
This crate is a submodule of DataFusion that provides data types and utilities for physical expressions.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/physical-optimizer/README.md b/datafusion/physical-optimizer/README.md
index eb361d3f67..374351b802 100644
--- a/datafusion/physical-optimizer/README.md
+++ b/datafusion/physical-optimizer/README.md
@@ -23,3 +23,10 @@ DataFusion is an extensible query execution framework, written in Rust,
that uses Apache Arrow as its in-memory format.
This crate contains the physical optimizer for DataFusion.
+
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/physical-plan/README.md b/datafusion/physical-plan/README.md
index ec604253fd..37cc165801 100644
--- a/datafusion/physical-plan/README.md
+++ b/datafusion/physical-plan/README.md
@@ -24,4 +24,9 @@
This crate is a submodule of DataFusion that contains the `ExecutionPlan` trait and the various implementations of that
trait for built in operators such as filters, projections, joins, aggregations, etc.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/proto-common/README.md b/datafusion/proto-common/README.md
index c8b46424f7..67b3b27870 100644
--- a/datafusion/proto-common/README.md
+++ b/datafusion/proto-common/README.md
@@ -24,5 +24,10 @@ bytes, which can be useful for sending data over the network.
See [API Docs] for details and examples.
+Most projects should use the [`datafusion-proto`] crate directly, which re-exports
+this module. If you are already using the [`datafusion-protp`] crate, there is no
+reason to use this crate directly in your project as well.
+
+[`datafusion-proto`]: https://crates.io/crates/datafusion-proto
[datafusion]: https://datafusion.apache.org
[api docs]: http://docs.rs/datafusion-proto/latest
diff --git a/datafusion/session/README.md b/datafusion/session/README.md
index 019f9f8892..f029c79736 100644
--- a/datafusion/session/README.md
+++ b/datafusion/session/README.md
@@ -23,4 +23,9 @@
This crate provides **session-related abstractions** used in the DataFusion query engine. A _session_ represents the runtime context for query execution, including configuration, runtime environment, function registry, and planning.
+Most projects should use the [`datafusion`] crate directly, which re-exports
+this module. If you are already using the [`datafusion`] crate, there is no
+reason to use this crate directly in your project as well.
+
[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
diff --git a/datafusion/sql/README.md b/datafusion/sql/README.md
index 98f3c4faa2..d5ef3114c1 100644
--- a/datafusion/sql/README.md
+++ b/datafusion/sql/README.md
@@ -25,6 +25,13 @@ project that requires a SQL query planner and does not make any assumptions abou
will be translated to a physical plan. For example, there is no concept of row-based versus columnar execution in the
logical plan.
+Note that the [`datafusion`] crate re-exports this module. If you are already
+using the [`datafusion`] crate in your project, there is no reason to use this
+crate directly in your project as well.
+
+[df]: https://crates.io/crates/datafusion
+[`datafusion`]: https://crates.io/crates/datafusion
+
## Example Usage
See the [examples](examples) directory for fully working examples.