HaoYang670 commented on issue #3249:
URL: 
https://github.com/apache/arrow-datafusion/issues/3249#issuecomment-1236241235

   Another question is that should we treat `treat view` as a lazy value or an 
expression?
   Let's say we have the following queries that use a `view v` multiple times
   ```
   create table t as select * from (values (1), (2), (3)) as sq;
   
   -- Create a view with a single predicate
   create view v as select * from t where column1 != 1;
   
   -- the first query using the view `v`
   explain select * from v where column1 != 2;
   
   -- the second query using the view `v`
   explain select * from v where column1 != 3;
   ```
   
   If the `v` is inlined in each query, we have to recompute it each time when 
using it. But as `v` is binded to an immutable dataframe, I'd like to access 
(or scan) it directly when it has been computed.
   
   I guess the expected behaviour here is similar to `lazy value`, which we 
just inline the `view` at the first time and remember its value, and in the 
following queries, we can `scan` the view directly. 
   
   (BTW, actually I am not very clear about the difference between  `create 
table` and `create view`)


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

Reply via email to