Re: [I] commit 304488d3... (2025-02-05) broke JOIN ... USING("UPPERCASE_FIELD_NAME") [datafusion]
jfahne commented on issue #16120: URL: https://github.com/apache/datafusion/issues/16120#issuecomment-2906960544 Okay so I dug through it and found the error is coming from the following call chain: - The `LogicalPlanBuilder` returned by the `parse_join` calls `join_using` on the builder ([link](https://github.com/apache/datafusion/blob/main/datafusion/sql/src/relation/join.rs#L151)) - The `left_keys` calculation from `join_using` calls the `LogicalPlanBuilder` method, `normalize` ([link](https://github.com/apache/datafusion/blob/main/datafusion/expr/src/logical_plan/builder.rs#L1127)) - The `normalize` method calls the `Column` struct method, `normalize_with_schemas_and_ambiguity_check` ([link](https://github.com/apache/datafusion/blob/main/datafusion/expr/src/logical_plan/builder.rs#L976)) - The `normalize_with_schemas_and_ambiguity_check` build a schema error for `FieldNotFound` because the passed `using_columns` argument is empty ([link](https://github.com/apache/datafusion/blob/main/datafusion/common/src/column.rs#L219)) This appears to be due to something happening here in the sql unparser ([link](https://github.com/apache/datafusion/blob/main/datafusion/sql/src/unparser/plan.rs#L1276)). I am still working out exactly what is going wrong but wanted to give an update. -- 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]
Re: [I] commit 304488d3... (2025-02-05) broke JOIN ... USING("UPPERCASE_FIELD_NAME") [datafusion]
alamb commented on issue #16120: URL: https://github.com/apache/datafusion/issues/16120#issuecomment-2898890449 Thank you for the report @brunal and for taking this @jfahne -- 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]
Re: [I] commit 304488d3... (2025-02-05) broke JOIN ... USING("UPPERCASE_FIELD_NAME") [datafusion]
jfahne commented on issue #16120: URL: https://github.com/apache/datafusion/issues/16120#issuecomment-2895962861 take -- 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]
[I] commit 304488d3... (2025-02-05) broke JOIN ... USING("UPPERCASE_FIELD_NAME") [datafusion]
brunal opened a new issue, #16120:
URL: https://github.com/apache/datafusion/issues/16120
### Describe the bug
Commit
https://github.com/apache/datafusion/commit/304488d348ad2c952ce24f93064a81046155da79
updated sqlparser (0.53->0.54) and updated datafusion source for it.
It broke SQL queries such as
SELECT test."UPPER" FROM "test"
INNER JOIN (
SELECT test."UPPER" FROM "test"
) AS selection USING ("UPPER")
This query fails with the message:
Schema error: No field named upper. Valid fields are test."UPPER".
You can find attached a patch that creates a test for this query. You can
run it with
$ cargo test -p datafusion -- sql::uppercase_fields::test_uppercase_columns
--exact --nocapture
[using_uppercase_bug.patch](https://github.com/user-attachments/files/20354094/using_uppercase_bug.patch)
### To Reproduce
_No response_
### Expected behavior
_No response_
### Additional context
_No response_
--
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]
