Boulea7 commented on code in PR #10611:
URL: https://github.com/apache/arrow-rs/pull/10611#discussion_r3755386511


##########
arrow-csv/src/reader/mod.rs:
##########
@@ -520,6 +520,18 @@ where
 }
 
 impl<R> BufReader<R> {
+    fn projected_schema(&self) -> SchemaRef {
+        match &self.decoder.projection {
+            Some(projection) => Arc::new(
+                self.decoder
+                    .schema
+                    .project(projection)
+                    .expect("invalid CSV projection"),

Review Comment:
   Good question — there was no earlier validation. Previously, an out-of-range 
index could panic either in `Reader::schema()` or while parsing the first 
batch; now `ReaderBuilder::build` returns a `SchemaError`, while the push 
decoder returns the same error from `flush` once input is buffered. Regression 
tests cover both paths.



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