jonahgao commented on issue #14118: URL: https://github.com/apache/datafusion/issues/14118#issuecomment-2597295238
Hi @logan-keede , thanks for your investigation. > Solution:- In [exprlist_to_fields()](https://github.com/apache/datafusion/blob/dc22b3fc846c23f69325be6e11c8ef204c3dc6be/datafusion/expr/src/utils.rs#L702) do not exclude columns from wildcard_schema more specifically do not explicitly call exclude_using_columns() `exclude_using_columns` is necessary, for example, for the following query, we need to ensure that it outputs only one column `a`. ``` DataFusion CLI v44.0.0 > create table t1(a int, b int); > create table t2(a int, c int); > select * from t1 join t2 using(a); +---+---+---+ | a | b | c | +---+---+---+ +---+---+---+ ``` > I am not sure if this will affect some other cases or not, but even if it does it will only show extra columns which is better than not showing any column at all. I think displaying extra columns may introduce more bugs, especially since the case in this issue is quite rare -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org