-
Notifications
You must be signed in to change notification settings - Fork 109
Fix JOIN clause to reference the correct table in SQL query generation #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
ty for your contribution, I'm not entirely sure I understand the issue you are trying to fix here, Can I ask what issue prompted the change? If you have a stack trace or something I can also take a look at it. |
kamir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if I got it right and if my suggestions is in line with your goal.
And please clarify the goal if it is something else.
Cheers, Mirko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem was in the test class:
SELECT * FROM testA JOIN testA ON testB.a=testA.a;
In JdbcJoinOperator.java
the code looks good.
...ms/wayang-jdbc-template/src/main/java/org/apache/wayang/jdbc/operators/JdbcJoinOperator.java
Show resolved
Hide resolved
The left table name comes from the tableSource
There was no initial issue as the tests we’re green but when working on something regarding join operations on the jdbc platform, I noticed the test checks for a self join syntax, which I assume was not intended. |
|
+1 for this PR. @treyfel maybe you can split up the return string into two strings (join part and predicates part) so that it's not confusing with a single return statement |
|
Hi @kamir, can you merge the PR? The suggested changes are correct |
Corrected the SQL JOIN clause in
JdbcJoinOperator#createSqlClauseto use the right table name when forming the JOIN statement, ensuring the SQL query generated is not a self-join.Updated the expected SQL query in
JdbcJoinOperatorTest#testWithHsqldbto match the corrected JOIN clause logic.