You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/04 20:59:01 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2690: Show column names instead of indices in query plans

andygrove commented on code in PR #2690:
URL: https://github.com/apache/arrow-datafusion/pull/2690#discussion_r889615100


##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -656,10 +656,22 @@ impl LogicalPlan {
                         ref limit,
                         ..
                     }) => {
+                        let projected_fields = match projection {
+                            Some(indices) => {
+                                let schema = source.schema();
+                                let names: Vec<&str> = indices
+                                    .iter()
+                                    .map(|i| schema.field(*i).name().as_str())
+                                    .collect();
+                                format!("Some([{}])", names.join(", "))

Review Comment:
   I started out doing that and it broke many tests that were expecting `None` so I decided to reduce the size of the change. I agree that it would be a nice improvement though. I'm happy to work on that as a follow-on PR.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org