-
Notifications
You must be signed in to change notification settings - Fork 590
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
Bug: outer_join generates LEFT join instead of full outer
#1772
Comments
|
I submitted my fix. I'm new to contributing to projects like this, so if there are any formalities or technicalities that I need to tweak to make this contribution possible, please let me know. I am open to guidance. Thanks to the community for how awesome |
scottcode
added a commit
to scottcode/ibis
that referenced
this issue
May 17, 2019
* Test using pytest framework that would catch bug in issue ibis-project#1772 (outer_join actually did a left join). * Fixed outer join portion of test_joins test method. * Removed unittest version of full outer test. * Refactored MockConnection and MockAlchemyConnection. In order for the test to catch this problem, it required changes to the MockAlchemyConnection class. Previously that class's dialect and _build_ast methods actually used implementations specific to Impala (objects from `ibis.impala.compiler`). This meant that the `outer_join` method compiled correctly in the sqlalchemy test because it was using the Impala compiler, whose implementation did not have the bug. To make clearer the similarities between Impala- and Alchemy-flavored mock connections, I refactored so they both share a BaseMockConnection class. However, I kept the name of the Impala-flavored one as MockConnection because it is used in several other tests. I wasn't sure if those other tests really should use Impala or Alchemy. As a to-do, those other tests should be checked for which flavor they ought to use, and the MockConnection should be renamed to MockImpalaConnection.
scottcode
added a commit
to scottcode/ibis
that referenced
this issue
May 17, 2019
* Test using pytest framework that would catch bug in issue ibis-project#1772 (outer_join actually did a left join). * Fixed outer join portion of test_joins test method. * Removed unittest version of full outer test. * Refactored MockConnection and MockAlchemyConnection. In order for the test to catch this problem, it required changes to the MockAlchemyConnection class. Previously that class's dialect and _build_ast methods actually used implementations specific to Impala (objects from `ibis.impala.compiler`). This meant that the `outer_join` method compiled correctly in the sqlalchemy test because it was using the Impala compiler, whose implementation did not have the bug. To make clearer the similarities between Impala- and Alchemy-flavored mock connections, I refactored so they both share a BaseMockConnection class. However, I kept the name of the Impala-flavored one as MockConnection because it is used in several other tests. I wasn't sure if those other tests really should use Impala or Alchemy. As a to-do, those other tests should be checked for which flavor they ought to use, and the MockConnection should be renamed to MockImpalaConnection.
cpcloud
pushed a commit
that referenced
this issue
May 17, 2019
Fixes issue #1772 Making new pull request from new branch freshly rebased on upstream master. Supercedes pull request #1773. Author: Scott Hajek <shajek@pivotal.io> Closes #1788 from scottcode/fix_full_outer_join2 and squashes the following commits: 4e2fdc4 [Scott Hajek] Shorten long source lines that were failing linter 3a6830d [Scott Hajek] Test for Alchemy-based full outer join 6c91ee9 [Scott Hajek] Fixes bug: `outer_join` generates LEFT join instead of full outer
|
Fixed by PR #1788 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When trying to create a full outer join using the
outer_joinmethod on aTableExpr, the resulting SQL is actually aLEFT OUTER JOIN.The root cause of it is that the method in
ibis.sql.alchemy._AlchemyTableSet.get_result()usessqlalchemy.sql.selectable.FromClause.outerjoin()with justresult.outerjoin(table, onclause). However, starting in sqlalchemy version1.1.0(circa 2016) they added a keyword argumentfullwith defaultFalse. To fix this we need to change the following:Current:
Proposed fix:
The text was updated successfully, but these errors were encountered: