rxdrccq commented on code in PR #27348:
URL: https://github.com/apache/datafusion/pull/27348#discussion_r4773251070


##########
datafusion/datasource-parquet/src/source.rs:
##########
@@ -1264,12 +1264,9 @@ impl ParquetSource {
         // must be decoded against the projected schema when a projection is
         // present.
         let predicate_schema = if !base_conf.projection.is_empty() {
-            let projected_fields: Vec<_> = base_conf
-                .projection
-                .iter()
-                .map(|&i| schema.field(i as usize).clone())
-                .collect();
-            Arc::new(Schema::new(projected_fields))
+            let projection: Vec<_> =
+                base_conf.projection.iter().map(|&i| i as usize).collect();
+            Arc::new(schema.project(&projection)?)

Review Comment:
   Done in 22c03e4e: the error now carries 
`ParquetScanExecNode.base_conf.projection` context and still includes the 
original Arrow error, and the byte-payload test checks both.



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