Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-7292 Hive on Spark
  3. HIVE-9041

Generate better plan for queries containing both union and multi-insert [Spark Branch]

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • spark-branch
    • 1.1.0
    • Spark
    • None

    Description

      This is a follow-up for HIVE-8920. For queries like:

      from (select * from table0 union all select * from table1) s
      insert overwrite table table3 select s.x, count(1) group by s.x
      insert overwrite table table4 select s.y, count(1) group by s.y;
      

      Currently we generate the following plan:

          M1    M2
            \  / \
             U3   R5
             |
             R4
      

      It's better, however, to have the following plan:

         M1  M2
         |\  /|
         | \/ |
         | /\ |
         R4  R5
      

      Also, we can do some reseach in this JIRA to see if it's possible
      to remove UnionWork once and for all.

      Attachments

        1. HIVE-9041.1-spark.patch
          249 kB
          Chao Sun
        2. HIVE-9041.2-spark.patch
          249 kB
          Chao Sun
        3. HIVE-9041.3-spark.patch
          251 kB
          Chao Sun

        Issue Links

          Activity

            People

              csun Chao Sun
              csun Chao Sun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: