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

Propagate partitioning properties for full outer join #154

Merged
merged 2 commits into from Feb 5, 2019

Conversation

3 participants
@martint
Copy link
Member

martint commented Feb 4, 2019

Extracted from https://github.com/prestodb/presto (original change approved by me).

@cla-bot cla-bot bot added the cla-signed label Feb 4, 2019

@martint martint force-pushed the martint:outer branch from c7883b8 to e3f81d8 Feb 4, 2019

@pgagnon

pgagnon approved these changes Feb 5, 2019

martint added some commits Feb 4, 2019

Clarify handling of constant properties
Constant bindings are replaced with a -1 in the list of channels used for partitioning.
Previously, this was achieved through indexOf returning such value when an entry wasn't
found in the list of bindings. This change makes the decision explicit.

Extracted-From: https://github.com/prestodb/presto
Propagate partition properties for full outer join
For full outer join, the outputs are effectively partitioned on a parwise combination
of the partitioning columns involved in the equi-join criteria. The combination function
is equivalente to sql's coalesce: the first non-null value between each pair of columns.

This is due to the following observations:

* If both input columns are null, they'll be reshuffled to the same node, so coalesce(null, null) => null
* Otherwise, for any combination of values of left & right, if a row is produce by the join, one of these
  must be true:
    * left is not null, right is not null and left = right, so both values are reshuffled to the same node
          => coalesce(left, right) = left = right
    * left is not null and there is no matching row => coalesce(left, null) = left, which can only be emitted
      by the node left was reshuffled to.
    * right is not null and there is no matching row => coalesce(null, right) = right, which can only be emitted
      by the node right was reshuffled to.

Extracted-from: https://github.com/prestosql/presto

@martint martint force-pushed the martint:outer branch from e3f81d8 to 64da531 Feb 5, 2019

@dain

dain approved these changes Feb 5, 2019

@martint martint merged commit c9f8a23 into prestosql:master Feb 5, 2019

1 check passed

verification/cla-signed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment