alamb commented on issue #13124:
URL: https://github.com/apache/datafusion/issues/13124#issuecomment-2439573517

   > Should we consider fixing this? I’m leaning towards not making changes, 
primarily to stay consistent with PostgreSQL’s syntax. Given the lack of test 
coverage, it seems this syntax might not be intentionally supported.
   
   I personally think it would nice to fix but there is no reason you need to 
do it personally or we need to block the 43 release for it. My rationale is:
   1. As you say this isn't something postgres supports
   2. there is a workaround for anyone relying on the old behavior -- which is 
to use another temporary relation
   
   
   Here is the workaround
   
   This fails
   ```sql
   CREATE OR REPLACE TABLE t(a int) AS SELECT length(a) FROM (VALUES ('abcd')) 
t(a); 
   SELECT * FROM t;
   ```
   
   You can rewrite it to:
   
   ```
   > CREATE OR REPLACE TABLE temp as  VALUES ('abcd');
   0 row(s) fetched.
   Elapsed 0.006 seconds.
   
   > CREATE OR REPLACE TABLE t(a int) AS SELECT length(column1) from temp;
   0 row(s) fetched.
   Elapsed 0.008 seconds.
   ```


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