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/04/06 18:50:54 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #2172: Add LogicalPlan::AliasedRelation

alamb commented on code in PR #2172:
URL: https://github.com/apache/arrow-datafusion/pull/2172#discussion_r844285723


##########
datafusion/core/src/logical_plan/builder.rs:
##########
@@ -518,6 +518,18 @@ impl LogicalPlanBuilder {
         })))
     }
 
+    /// Apply an alias
+    pub fn alias(&self, alias: &str) -> Result<Self> {

Review Comment:
   Another way that this same aliasing can be represented is a `Projection` node
   
   So if the input has schema with columns `a`, `b`, `c`
   
   Then to implement `alias("foo")` you could build a `LogicalPlanNode` that was `Project([a foo.a, b as foo.b, c as foo.c])`
   
   There may be some good reason to introduce a new type of LogicalPlanNode too that I don't understand, but I wanted to point out this alternative
   



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