xudong963 commented on a change in pull request #1088:
URL: https://github.com/apache/arrow-datafusion/pull/1088#discussion_r725389886
##########
File path: datafusion/src/optimizer/projection_push_down.rs
##########
@@ -417,9 +416,15 @@ fn optimize_plan(
})
.collect::<Result<Vec<_>>>()?;
+ let mut new_schema = Vec::new();
+ for df_field in schema.fields() {
+ if union_required_fields.contains(df_field.field()) {
+ new_schema.push(df_field.clone());
+ }
+ }
Review comment:
Yes, I also like the cool and concise functional style. But because I'm
not familiar with functional programming style, I chose conservative writing at
the beginning. Thanks for your suggestion!
--
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]