Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18978

ConditionalTask.addDependentTask(Task t) adds t in the wrong place

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Query Processor
    • None

    Description

      {{ConditionalTask.addDependentTask(Task t) }} is implemented like this:

      /**
      * Add a dependent task on the current conditional task. The task will not be a direct child of
      * conditional task. Actually it will be added as child task of associated tasks.
      *
      * @return true if the task got added false if it already existed
      */
      @Override
      public boolean addDependentTask(Task<? extends Serializable> dependent) {
        boolean ret = false;
        if (getListTasks() != null) {
          ret = true;
          for (Task<? extends Serializable> tsk : getListTasks()) {
            ret = ret & tsk.addDependentTask(dependent);
          }
        }
        return ret;
      }
      

      So let’s say, the tasks in the ConditionalTask are A,B,C, but they have children.

          CondTask
            |--A
               |--A1
                  |-A2
            |--B
               |--B1
            |--C
              |--C1
      

      The way ConditionalTask.addDependent() is implemented, MyTask becomes a sibling of A1,
      B1 and C1. So even if only 1 branch of ConditionalTask is executed (and parallel task
      execution is enabled), there is no guarantee (as I see) that MyTask runs after A2 or
      B1 or C1, which is really what is needed.

       

      Once this is done add a .q file test that records a plan for Export from Acid: HIVE-18739

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ekoifman Eugene Koifman
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: