You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/07/22 19:14:18 UTC

Re: [PR] Implement physical plan serialization for csv COPY plans , add `as_any`, `Debug` to `FileFormatFactory` [datafusion]

alamb commented on code in PR #11588:
URL: https://github.com/apache/datafusion/pull/11588#discussion_r1687025318


##########
datafusion/core/src/datasource/file_format/mod.rs:
##########
@@ -63,6 +63,10 @@ pub trait FileFormatFactory: Sync + Send + GetExt {
 
     /// Initialize a [FileFormat] with all options set to default values
     fn default(&self) -> Arc<dyn FileFormat>;
+
+    /// Returns the table source as [`Any`] so that it can be

Review Comment:
   💯 



##########
datafusion/core/src/datasource/file_format/mod.rs:
##########
@@ -149,6 +154,11 @@ impl DefaultFileType {
             file_format_factory,
         }
     }
+
+    /// get a [FileFormatFactory] struct
+    pub fn get_format_factory(&self) -> Arc<dyn FileFormatFactory> {

Review Comment:
   Another more 'rust idomatic' way to do this might be a method like this (which would allow the user to choose to copy if they wanted or use the reference)
   
   ```rust
       /// get a reference to the inner [FileFormatFactory] struct
       pub fn as_format_factory(&self) -> &Arc<dyn FileFormatFactory> {
           &self.file_format_factory
       }
   ```
   
   



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org