returnString commented on a change in pull request #9710:
URL: https://github.com/apache/arrow/pull/9710#discussion_r596759762



##########
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:
       That makes sense to me; agreed that (personally, at least) I'll give 
less consideration to projects without simple readme examples.
   
   It balloons the scope of this PR quite a lot so I'm not saying this is a 
_good_ idea, but I just did a bit of digging and it looks like people have gone 
through this particular problem before: 
https://blog.guillaume-gomez.fr/articles/2019-04-13+Keeping+Rust+projects%27+README.md+code+examples+up-to-date
   
   And the end result of that  is https://crates.io/crates/doc-comment, which 
looks like it'll wire up any `rust`-tagged code blocks in external files as 
doctests, optionally only for `#[cfg(test)]`.
   
   If it's useful, I could log a followup task to integrate that and take a 
look at it myself?




----------------------------------------------------------------
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]


Reply via email to