wyatt-herkamp commented on code in PR #27021:
URL: https://github.com/apache/datafusion/pull/27021#discussion_r4527588448


##########
datafusion/datasource-csv/src/source.rs:
##########
@@ -440,26 +774,46 @@ impl FileOpener for CsvOpener {
                     )
                 })?;
 
+                // A partition may start mid-file, so the header is fetched
+                // separately. Every byte-range partition of a file repeats 
this
+                // small request; cache per file if that becomes costly.
+                let mapping = if match_by_header {
+                    let header =
+                        fetch_header(&config, store.as_ref(), &location, 
file_size)
+                            .await?;
+                    // A partition starting within leading comment lines owns
+                    // the header row, so it has to skip it.
+                    if raw_start <= header.start as u64 {

Review Comment:
   @zhuqi-lucas header ownership follows `AlignedBoundaryStream`.  



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to