berkaysynnada commented on code in PR #10650:
URL: https://github.com/apache/datafusion/pull/10650#discussion_r1615535832


##########
datafusion/core/src/datasource/file_format/csv.rs:
##########
@@ -301,13 +296,7 @@ impl CsvFormat {
 
         while let Some(chunk) = stream.next().await.transpose()? {
             let format = arrow::csv::reader::Format::default()
-                .with_header(
-                    first_chunk
-                        && self
-                            .options
-                            .has_header
-                            
.unwrap_or(state.config_options().catalog.has_header),
-                )
+                .with_header(first_chunk && self.options.has_header)

Review Comment:
   Thanks @metegenez for the review :) I have tried to extract the option from 
the catalog in the most inclusive way possible. This step seems to be when we 
create a `TableProvider`.
   
   Another alternative would be to consult the catalog wherever we read the 
header from a `FileFormat`. However, doing this everywhere makes the code 
cluttered (in many places, there isn't even a catalog object available). 
Therefore, I think that if we check this once during the execution, where 
`FileFormat` is first introduced—that is, at the part where `TableProvider` is 
created—we won't need to check it again. Are there any use cases for creating 
and using `FileFormat` independently of any `TableProvider`?



-- 
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-unsubscr...@datafusion.apache.org

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


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

Reply via email to