alamb opened a new issue, #2529:
URL: https://github.com/apache/arrow-datafusion/issues/2529

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   As suggested by @Dandandan  on 
https://github.com/apache/arrow-datafusion/pull/2279#discussion_r869751636 it 
would be very nice to be able to see the original SQL used to define a view.
   
   Apparently postgres uses a function: 
https://stackoverflow.com/questions/14634322/how-to-see-the-create-view-code-for-a-view-in-postgresql
   
   Mysql uses `SHOW CREATE VIEW`: 
https://dev.mysql.com/doc/refman/8.0/en/show-create-view.html
   
   
   ```sql
   mysql> create view f as select * from foo;
   Query OK, 0 rows affected (0.00 sec)
   
   mysql> show create view f;
   
+------+----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
   | View | Create View                                                         
                                                                               
| character_set_client | collation_connection |
   
+------+----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
   | f    | CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY 
DEFINER VIEW `f` AS select `foo`.`bar` AS `bar`,`foo`.`baz` AS `baz` from `foo` 
| utf8mb4              | utf8mb4_0900_ai_ci   |
   
+------+----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
   1 row in set (0.00 sec)
   ```
   
   
   **Describe the solution you'd like**
   Store the original SQL and make it accessable via SQL
   
   **Describe alternatives you've considered**
   
   
   **Additional context**
   
   https://github.com/apache/arrow-datafusion/pull/2279
   


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