Uh oh!
There was an error while loading. Please reload this page.
Added transitive closure transformation to Catalyst - #11777
Conversation
AmplabJenkins
commented
Mar 17, 2016
Can one of the admins verify this patch? |
rxin
commented
Mar 18, 2016
This is similar to #11618 isn't it? |
antonoal
commented
Mar 18, 2016
Yes and no. This change handles a bit more cases, not just column == constant, and it works on an earlier phase - logical plan optimisation rather than physical. It is a question whether the second point is better or worse in my change. |
sameeragarwal
commented
Mar 18, 2016
@antonoal Thanks a lot for looking into this! As @rxin pointed out, we currently infer these transitive predicates by looking at the data constraints for each operator in the logical plan (please also see #11665). Can you please replace your |
antonoal
commented
Mar 19, 2016
It does cover all my tests and looks a lot neater, so feel free to decline this PR. |
srowen
commented
Mar 19, 2016
@antonoal you'd have to close this PR. See https://cwiki.apache.org/confluence/display/SPARK/Contributing+to+Spark |
sameeragarwal
commented
Mar 19, 2016
yes, the |
gatorsmile
commented
Mar 19, 2016
Yeah, we have another PR: #10566. That PR is waiting for the related PR merged. |
What changes were proposed in this pull request?
A relatively simple transformation is missing from Catalyst's arsenal - generation of transitive predicates. For instance, if you have got the following query:
select * from table1 t1 join table2 t2 on t1.a = t2.b where t1.a = 42then it is a fair assumption that t2.b also equals 42 hence an additional predicate could be generated. The additional predicate could in turn be pushed down through the join and improve performance of the whole query by filtering out the data before joining it.
Such a transformation exists in Oracle DB.
Please note, in this PR a transitive predicate would be created for the following operations:
How was this patch tested?
I've added a new TransitiveClosureSuite with a series of unit tests