-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
The following logic in JoinParser.java translates an outer join with join condition that is trivially true into an inner join with the same condition.
spes/src/main/java/AlgeNodeParser/JoinParser.java
Lines 44 to 49 in 8049f98
| if (joinCondition.getKind() == SqlKind.LITERAL) { | |
| RexLiteral maybeTrue = (RexLiteral) joinCondition; | |
| if (maybeTrue.isAlwaysTrue()){ | |
| return constructNode(result,z3Context); | |
| } | |
| } |
However, a left outer join with join condition
TRUE would still generate null rows when the right table is empty, making it nonequivalent to an inner join.
The branch right above also seems off.
spes/src/main/java/AlgeNodeParser/JoinParser.java
Lines 41 to 43 in 8049f98
| if (joinCondition.getKind() == SqlKind.IS_TRUE) { | |
| return constructNode(result,z3Context); | |
| } |
I believe
SqlKind.IS_TRUE indicates the IS TRUE operator, not that the condition is trivially true. Translating R1 LEFT JOIN R2 ON P IS TRUE into R1 INNER JOIN R2 ON P IS TRUE for arbitrary predicate P is clearly not right.
Please let me know if I am misunderstanding anything. Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels