saikrishna1-bidgely commented on code in PR #4908:
URL: https://github.com/apache/arrow-datafusion/pull/4908#discussion_r1083336098
##########
datafusion/core/src/execution/context.rs:
##########
@@ -1035,6 +1037,65 @@ impl FunctionRegistry for SessionContext {
}
}
+#[async_trait]
+pub trait Reader<'a, T>: Sized {
+ async fn read_csv(&self, table_paths: T, options: CsvReadOptions<'_>) ->
Result<DataFrame>
+ where 'a:'async_trait
+ ;
+}
+
+#[async_trait]
+impl<'a> Reader<'a, &'a str> for SessionContext {
+ async fn read_csv(&self, table_path: &'a str, options: CsvReadOptions<'_>)
-> Result<DataFrame> {
+ self.read_csv(vec![table_path], options).await
+ }
+}
+
+#[async_trait]
+impl<'a> Reader<'a, String> for SessionContext {
Review Comment:
We can't use AsRef<str> here. We have to implement both `&str` and `String`
seperately.
--
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]