jonahgao commented on PR #10876:
URL: https://github.com/apache/datafusion/pull/10876#issuecomment-2165896403

   
   
   
   > Thank you for the careful review, I have addressed all comments.
   > 
   > The CTE case had not occurred to me so thanks for pointing it out. I have 
separated the CTE list in the return value, returning a `(table_refs, ctes)` 
tuple, as I suspect most uses of this are not interested in CTE names and would 
rather exclude them.
   
   Thank you @leoyvens . But I prefer the previous implementation and take 
alamb's approach to remind users in the comments. So that if users find a table 
reference that does not exist in their catalog, they do not immediately judge 
it as an error because it could be a CTE name.
   
   
   Implementing a separated CTE list could be error-prone, especially 
considering the scope of CTEs. For example, in `WITH t AS (SELECT * FROM t) 
SELECT * FROM t`, the first 't' may reference ordinary table, and the second 
't' references a CTE.
   And we already have specialized logic to handle this problem during planning.


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