hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Szehon Ho (JIRA)" <>
Subject [jira] [Updated] (HIVE-9007) Hive may generate wrong plan for map join queries due to IdentityProjectRemover [Spark Branch]
Date Wed, 24 Dec 2014 21:24:13 GMT


Szehon Ho updated HIVE-9007:
    Attachment: HIVE-9007-spark.patch

IdentityProjectRemover removes unnecessary Select/Fil operators.

I tried some hacks on Spark compiler's mapjoin optimizers to work with this kind of graph
(where multiple RS are connected to each other without intermediate Sel/Fil).  But it's too
hard as this affects where they cut the ReduceWork, and loses the rowSchema from for ReduceSink
-> HTSink conversion.  So disabling for spark compilation.

Wrote a new test that stresses this case.  Interestingly, it does not seem to work for MapReduce

> Hive may generate wrong plan for map join queries due to IdentityProjectRemover [Spark
> ----------------------------------------------------------------------------------------------
>                 Key: HIVE-9007
>                 URL:
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Spark
>    Affects Versions: spark-branch
>            Reporter: Chao
>            Assignee: Szehon Ho
>         Attachments: HIVE-9007-spark.patch
> HIVE-8435 introduces a new logical optimizer called IdentityProjectRemover, which may
cause map join in spark branch to generate wrong plan.
> Currently, the map join conversion in spark branch first goes through a method {{convertJoinMapJoin}},
which replaces a join op with a mapjoin op, removes RS associated with big table, and keep
RSs for all small tables. Afterwards, in {{SparkReduceSinkMapJoinProc}} it replaces all parent
RSs of the mapjoin op with HTS (note it doesn't check whether the RS belongs to small table
or big table.)
> The issue arises, when IdentityProjectRemover comes into play, which may result into
a situation that a operator tree has two consecutive RSs. Imaging the following example:
> {noformat}
>           Join               MapJoin
>           / \                /   \
>         RS   RS   --->     RS     RS
>        /      \           /         \
>       TS       RS       TS          TS (big table)
>                 \      (small table)
>                  TS
> {noformat}
> In this case, all parents of the mapjoin op will be RS, even the branch for big table!
In {{SparkReduceSinkMapJoinProc}}, they will be replaced with HTS, which is obviously incorrect.

This message was sent by Atlassian JIRA

View raw message