pepijnve opened a new issue, #26997:
URL: https://github.com/apache/datafusion/issues/26997

   ### Describe the bug
   
   The `information_schema.views.definition` columns incorrectly contains the 
`CREATE VIEW` statement that was used to create the view. Per the specification 
this should actually be the query statement that the view represents. I 
verified empirically that this is also what PostgreSQL and MySQL return in this 
column.
   
   ### To Reproduce
   
   ```
   > create view v as select * from information_schema.tables;
   0 row(s) fetched.
   Elapsed 0.030 seconds.
   
   > select * from information_schema.views;
   
+---------------+--------------+------------+----------------------------------------------------------+
   | table_catalog | table_schema | table_name | definition                     
                          |
   
+---------------+--------------+------------+----------------------------------------------------------+
   | datafusion    | public       | v          | CREATE VIEW v AS SELECT * FROM 
information_schema.tables |
   
+---------------+--------------+------------+----------------------------------------------------------+
   ```
   
   ### Expected behavior
   
   ```
   > select * from information_schema.views;
   
+---------------+--------------+------------+----------------------------------------------------------+
   | table_catalog | table_schema | table_name | definition                     
                          |
   
+---------------+--------------+------------+----------------------------------------------------------+
   | datafusion    | public       | v          | SELECT * FROM 
information_schema.tables |
   
+---------------+--------------+------------+----------------------------------------------------------+
   ```
   
   ### Additional context
   
   _No response_
   
   ### Willingness to contribute
   
   I plan to contribute a fix for this bug independently


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to