Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-1644

New logical plan: Plan.connect with position is misused in some places

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 0.8.0
    • impl
    • None
    • Reviewed

    Description

      When we replace/remove/insert a node, we will use disconnect/connect methods of OperatorPlan. When we disconnect an edge, we shall save the position of the edge in origination and destination, and use this position when connect to the new predecessor/successor. Some of the pattens are:

      Insert a new node:

      Pair<Integer, Integer> pos = plan.disconnect(pred, succ);
      plan.connect(pred, pos.first, newnode, 0);
      plan.connect(newnode, 0, succ, pos.second);
      

      Remove a node:

      Pair<Integer, Integer> pos1 = plan.disconnect(pred, nodeToRemove);
      Pair<Integer, Integer> pos2 = plan.disconnect(nodeToRemove, succ);
      plan.connect(pred, pos1.first, succ, pos2.second);
      

      Replace a node:

      Pair<Integer, Integer> pos1 = plan.disconnect(pred, nodeToReplace);
      Pair<Integer, Integer> pos2 = plan.disconnect(nodeToReplace, succ);
      plan.connect(pred, pos1.first, newNode, pos1.second);
      plan.connect(newNode, pos2.first, succ, pos2.second);
      

      There are couple of places of we does not follow this pattern, that results some error. For example, the following script fail:

      a = load '1.txt' as (a0, a1, a2, a3);
      b = foreach a generate a0, a1, a2;
      store b into 'aaa';
      c = order b by a2;
      d = foreach c generate a2;
      store d into 'bbb';
      

      Attachments

        1. PIG-1644-4.patch
          43 kB
          Daniel Dai
        2. PIG-1644-3.patch
          42 kB
          Daniel Dai
        3. PIG-1644-2.patch
          44 kB
          Daniel Dai
        4. PIG-1644-1.patch
          15 kB
          Daniel Dai

        Activity

          People

            daijy Daniel Dai
            daijy Daniel Dai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: