DataPsycho commented on code in PR #4360:
URL: https://github.com/apache/arrow-datafusion/pull/4360#discussion_r1033684577


##########
datafusion-examples/examples/dataframe.rs:
##########
@@ -41,3 +44,66 @@ async fn main() -> Result<()> {
 
     Ok(())
 }
+
+// Example to read data from a csv file with inferred schema
+async fn example_read_csv_file_with_inferred_schema() -> Arc<DataFrame> {
+    let path = "example.csv";
+    // Create the data to put into the csv file with headers
+    let content = r#"id,time,vote,unixtime,rating
+    a1,\"10 6, 2013\",3,1381017600,5.0
+    a2,\"08 9, 2013\",2,1376006400,4.5"#;
+    // write the data
+    fs::write(path, content).expect("Problem with writing file!");

Review Comment:
   Sure thing. As my first commit, I just want to add some stuff. I have a lot 
more examples to add then I will update it and create a separate function for 
each type of data files like excel, json etc.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to