alamb commented on PR #2279:
URL:
https://github.com/apache/arrow-datafusion/pull/2279#issuecomment-1106809142
Sorry for the late review @matthewmturner
At a high level, I would expect a VIEW to be represented by a query -- maybe
as a SQL string / parsed `Query` or perhaps a `LogicalPlan`
So let's say we have a query like this
```sql
select sum(y) from T where a > 5 group by a;
```
If `T` is a table, I would expect the plan to look like
```
GroupBy (gby a, sum(y))
Filter(a > 5)
TableScan T
```
If `T` is a view,
```sql
create view T as select a, y from bar where y > 10000
```
I would expect the plan to look like:
```
GroupBy (gby a, sum(y))
Filter(a > 5)
Project (a, y) <-- the LogicalPlan for the View is pasted in here
Filter (y > 10000)
TableScan bar
```
The question then becomes how do you want to get the `LogicalPlan` for the
view when it is referenced. Storing a SQL string might be the simplest, but I
am not sure how that would work with the [DataFrame
API](https://github.com/apache/arrow-datafusion/blob/baa2a367ec159992705befc5c735fe3324a83680/datafusion/core/src/dataframe.rs)
But then again, I am not sure a view makes sense in the context of a
dataframe -- the user would just clone the DataFrame (which is a wrapper around
a `LogicalPlan` 🤔 )
--
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]