-
Notifications
You must be signed in to change notification settings - Fork 85
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
AssertionError in using UNION and JOIN - DataJoint 0.13.* error #930
Comments
I am not quite sure why you would join (q1 + q2) and TableA.
Are you sure you should be able to do this? There may be a reason it is throwing an assertion error since (q1 + q2) already produces the result you are looking for. I would appreciate some clarification as I am looking into this @ttngu207. |
Hi @jverswijver , thanks for taking on this.
|
posting the make sqls between the different datajoint releases using the example given (q1 + q2).make_sql() #0.13.2 (SELECT DISTINCT `table_a`,`table_b` FROM `test`.`table_b` WHERE(table_a < 3))
UNION
(SELECT DISTINCT `table_a`,`table_b` FROM `test`.`table_b` WHERE(table_a > 3)) ((q1 + q2) * TableA).make_sql() #0.13.2 SELECT DISTINCT `table_a`,`table_b`
FROM (
SELECT DISTINCT `table_a`,`table_b`
FROM `test`.`table_b`
WHERE(table_a < 3)) as `$8`
NATURAL JOIN (
SELECT DISTINCT `table_a`,`table_b` FROM `test`.`table_b`
WHERE(table_a > 3)
) as `$9` (q1 + q2).make_sql() #0.12.9 SELECT `table_a`,`table_b`
FROM (
SELECT `table_a`,`table_b`
FROM `test`.`table_b` WHERE (table_a < 3)
UNION
SELECT `table_a`,`table_b`
FROM `test`.`table_b`
WHERE (table_a > 3)
) as `_u4` ((q1 + q2) * TableA).make_sql() #12.9 SELECT `table_a`,`table_b`
FROM (
SELECT `table_a`,`table_b`
FROM `test`.`table_b`
WHERE (table_a < 3)
UNION
SELECT `table_a`,`table_b`
FROM `test`.`table_b`
WHERE (table_a > 3)
) as `_u5`
NATURAL JOIN `test`.`table_a` In 0.13.2 we somehow lose the union when joining a union and a table. I had to comment out the assertion to get the make_sql in 0.13.2 |
Fix #930 union join bug, Add test for union join.
Bug Report
Description
Performing a JOIN operation on a UNION results in
AssertionError
in DataJoint 0.13.* - this is OK in 0.12.*May be related to #926
Reproducibility
Include:
Example case to reproduce the issue:
Error stack:
In DataJoint 0.12.7, this yields the results as expected:
The text was updated successfully, but these errors were encountered: