hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phabricator (JIRA)" <>
Subject [jira] [Commented] (HIVE-3464) Merging join tree may reorder joins which could be invalid
Date Mon, 21 Jan 2013 10:04:14 GMT


Phabricator commented on HIVE-3464:

navis has commented on the revision "HIVE-3464 [jira] Merging join tree may reorder joins
which could be invalid".

  ql/src/test/queries/clientpositive/mergejoins_mixed.q:19 1. (a-b-c-d)
  A(a.key=b.key) + B(b.key=c.key) + C(a.key=d.key)
  makes single join ABC(a.key=b.key=c.key=d.key)

  2. ((a-b-d)-c) or (((a-b)-c)-d)
  A(a.key=b.key) + B(b."value"=c.key) + C(a.key=d.key)
  before patch, hive tries merging C->B, C->A, B->A order (outer to inner), and C->A
only will be merged, making two joins : AC(a.key=b.key=d.key) + B(b.value=c.key).
  This makes C join is executed prior to B and if join type of C is different from that of
B, it's illegal.

  Patch consist of two parts.
  1. reverted merging order (inner to outer). It makes it a little easier to check condition
  2. check if it's possible to switch join ordering (if it has same join type)


To: JIRA, navis
Cc: njain

> Merging join tree may reorder joins which could be invalid
> ----------------------------------------------------------
>                 Key: HIVE-3464
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 0.10.0
>            Reporter: Navis
>            Assignee: Navis
>         Attachments: HIVE-3464.D5409.2.patch, HIVE-3464.D5409.3.patch
> Currently, hive merges join tree from right to left regardless of join types, which may
introduce join reordering. For example,
> select * from a join a b on a.key=b.key join a c on b.key=c.key join a d on a.key=d.key;

> Hive tries to merge join tree in a-d=b-d, a-d=a-b, b-c=a-b order and a-d=a-b and b-c=a-b
will be merged. Final join tree is "a-(bdc)".
> With this, ab-d join will be executed prior to ab-c. But if join type of -c and -d is
different, this is not valid.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message