tustvold commented on code in PR #3468:
URL: https://github.com/apache/arrow-rs/pull/3468#discussion_r1062927669


##########
arrow-csv/src/reader/mod.rs:
##########
@@ -1124,6 +1124,31 @@ mod tests {
 
     use chrono::prelude::*;
 
+    #[test]
+    fn rows_unequal_length() {
+        let file = File::open("test/data/unequal_lengths.csv").unwrap();
+        let schema = Schema::new(vec![
+            Field::new("foo", DataType::Int32, false),
+            Field::new("bar", DataType::Int32, false),
+        ]);
+        let mut csv = Reader::new(
+            file,
+            Arc::new(schema.clone()),
+            false,
+            None,
+            1024,
+            None,
+            None,
+            None,
+        );
+        let batch = csv.next().unwrap();
+        assert!(batch.is_err());
+        assert_eq!(
+            "Csv error: incorrect number of fields, expected 2 got 3",

Review Comment:
   This logic is only used by the inference logic, not the reader



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