alamb commented on a change in pull request #9710:
URL: https://github.com/apache/arrow/pull/9710#discussion_r596727864
##########
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:
This is a good point @returnString
The way I justified the danger of drift to myself was "the main usecase of
this documentation (the overview) is likely to help them answer the question of
"should I even bother to try and use this crate". Once they decide to try and
actually use the crate they will look at the real docs on docs.rs (from which
they can copy/paste).
For the purpose of an example of "what does this library do" I felt even a
slightly out of date example might be valuable.
Or maybe I am just trying to pad my github stats ;) But in all seriousness I
am not committed to this PR. If it isn't a good idea I can just close it
----------------------------------------------------------------
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]