srijithr03 commented on code in PR #10903:
URL: https://github.com/apache/arrow-rs/pull/10903#discussion_r3889018686


##########
arrow-csv/src/reader/mod.rs:
##########
@@ -351,6 +362,16 @@ impl Format {
         self
     }
 
+    /// Whether to ignore extra fields when parsing.
+    ///
+    /// By default this is set to `ExtraFields::Error` and will error if the 
CSV rows have more
+    /// columns than expected. When set to `ExtraFields::Ignore` then it will 
allow records with
+    /// more than the expected number of columns and ignore the extra fields.
+    pub fn with_extra_fields(mut self, extra_fields: ExtraFields) -> Self {
+        self.extra_fields = extra_fields;
+        self

Review Comment:
   Thanks for catching this. I’ve updated `Format::build_reader()` so 
`ExtraFields::Ignore` also enables flexible parsing during schema inference.
   
   I also added regression tests covering both `ExtraFields::Ignore` and 
`ExtraFields::Error` during inference.



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