Igosuki opened a new issue #1740:
URL: https://github.com/apache/arrow-datafusion/issues/1740
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
Currently we can create external and in memory listing tables, I want to go
further and allow creating views from SQL queries.
Registering a dataframe as a table requires the following :
```
let table = ctx.clone().sql(&sql_query).await?;
let df_impl = Arc::new(DataFrameImpl::new(ctx.state.clone(),
&table.to_logical_plan()));
ctx.register_table(table_name.as_str(), df_impl.clone())?;
```
**Describe the solution you'd like**
Since DataframeImpl is already a TableType::View,
registering/droping/altering a view could be done from SQL, or directly with
```ctx.create_view(df: Arc<dyn DataFrame>) or df.register_as_view(name: impl
Into<TableReference>)```
and
```
ctx.sql("CREATE VIEW records AS select * from other_records where ...")
```
**Describe alternatives you've considered**
Leaving things as is
**Additional context**
Make it easier to use arrow-datafusion without knowing its internals.
--
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]