returnString commented on a change in pull request #9710:
URL: https://github.com/apache/arrow/pull/9710#discussion_r596404956
##########
File path: rust/datafusion/README.md
##########
@@ -58,6 +58,49 @@ Here are some of the projects known to use DataFusion:
(if you know of another project, please submit a PR to add a link!)
+## Example Usage
+
+Run a SQL query against data stored in a CSV:
+
+```rust
+ let mut ctx = ExecutionContext::new();
+ ctx.register_csv("example", "tests/example.csv", CsvReadOptions::new())?;
+
+ // Create a plan to run a SQL query
+ let df = ctx.sql("SELECT a, MIN(b) FROM example GROUP BY a LIMIT 100")?;
+
+ // execute and print results
+ let results: Vec<RecordBatch> = df.collect().await?;
+ print_batches(&results)?;
+```
+
+Use the DataFrame API to process data stored in a CSV:
+
+```rust
Review comment:
Nitpicking: this might be a little bit fun with API churn, e.g. I
believe the input expr ownership work you've recently opened would change these
from slices to vecs and we don't have a way to catch that automatically like we
do for the in-crate docs (am I right in thinking that `cargo test` runs all
doctests?).
Edit: to be clear, I don't think it's a reason to not do it, just curious if
anyone has ideas for how to prevent doc drift :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]