saikrishna1-bidgely commented on code in PR #4908:
URL: https://github.com/apache/arrow-datafusion/pull/4908#discussion_r1083341999


##########
datafusion/core/src/execution/context.rs:
##########
@@ -1035,6 +1037,80 @@ impl FunctionRegistry for SessionContext {
     }
 }
 
+#[async_trait]
+/// Trat implementing `read_csv`, `read_avro`, `read_json` and `read_parquet`.
+/// We implement these functions for `String`, `&str`, `Vec<&str>` and 
`Vec<String>`.
+/// This way these functions can accept either a single path or a list of 
paths.
+/// 
+/// An example of using these methods is given below.
+/// ```rust
+/// let ctx = SessionContext::default();
+/// ctx.read_csv("s3://bucket-name/key/")
+/// ctx.read_csv(vec!["s3://bucket-name/key/", "s3://bucket-name/key2/", 
"s3://another-bucket-name/key/"])
+/// ```
+pub trait Reader<'a, T>: Sized {
+
+    /// Creates a [`DataFrame`] for reading a CSV data source.
+    ///
+    /// For more control such as reading multiple files, you can use
+    /// [`read_table`](Self::read_table) with a [`ListingTable`].
+    async fn read_csv(&self, table_paths: T, options: CsvReadOptions<'_>) -> 
Result<DataFrame>

Review Comment:
   For now implemented only for `read_csv` but once it gets finalised for it, 
I'll implement for the rest of the methods.



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