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/07 01:16:39 UTC

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

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


##########
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:
   I think I need something to very specifically say that a table is being used as an alias. An easier change might be just to add an additional field to the `TableScan` to record the original table name. I think I will put up a separate PR for that approach.
   
   So to explain why I need this. I want to use DataFusion as a SQL parser and planner but I want to execute the query in a different engine. I can provide a `TableProvider` so that DataFuision can get the schema for table `person` and I get a logical plan. When I go to translate that plan to a physical plan, it refers to a table called `peeps` (the alias) and I have no way to know the actual table name.



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