Package org.apache.pig.pen.util

Examples of org.apache.pig.pen.util.ExampleTuple


    //

    ExampleTuple GenerateMatchingTuple(Tuple constraint, LogicalPlan predicate,
            boolean invert) throws ExecException {
        Tuple t = TupleFactory.getInstance().newTuple(constraint.size());
        ExampleTuple tOut = new ExampleTuple(t);
        for (int i = 0; i < t.size(); i++)
            tOut.set(i, constraint.get(i));

        GenerateMatchingTupleHelper(tOut, (ExpressionOperator) predicate
                .getLeaves().get(0), invert);
        tOut.synthetic = true;
        return tOut;
View Full Code Here


 
  output.set(0, smallestTuple.get(1));
  for(int i = 1; i < size + 1; i++) {
      output.set(i, BagFactory.getInstance().newDefaultBag());
  }
  ExampleTuple tOut = null;
  if(lineageTracer != null) {
      tOut = new ExampleTuple(output);
      lineageTracer.insert(tOut);
  }
 
  boolean loop = true;
 
View Full Code Here

        && res.returnStatus != POStatus.STATUS_NULL)
    return res;

      if (res.result != null && (Boolean) res.result == true) {
    if(lineageTracer != null) {
        ExampleTuple tIn = (ExampleTuple) inp.result;
        lineageTracer.insert(tIn);
        lineageTracer.union(tIn, tIn);
    }
    return inp;
      }
View Full Code Here

            }

        }
       
        if(lineageTracer != null) {
            ExampleTuple tOut = new ExampleTuple();
            tOut.reference(out);
            lineageTracer.insert(tOut);
            for(int i = 0; i < data.length; i++) {
                lineageTracer.union(tOut, data[i]);
            }
            return tOut;
View Full Code Here

                    && res.returnStatus != POStatus.STATUS_NULL)
                return res;

            if (res.result != null && (Boolean) res.result == true) {
          if(lineageTracer != null) {
              ExampleTuple tIn = (ExampleTuple) inp.result;
              lineageTracer.insert(tIn);
              lineageTracer.union(tIn, tIn);
          }
                return inp;
            }
View Full Code Here

        if(processingPlan){
            while(true) {
                res = processPlan();
                if(res.returnStatus==POStatus.STATUS_OK) {
                    if(lineageTracer !=  null && res.result != null) {
                  ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
                  tOut.synthetic = tIn.synthetic;
                  lineageTracer.insert(tOut);
                  lineageTracer.union(tOut, tIn);
                  res.result = tOut;
                    }
                    return res;
                }
                if(res.returnStatus==POStatus.STATUS_EOP) {
                    processingPlan = false;
                    return res;
                }
                if(res.returnStatus==POStatus.STATUS_ERR) {
                    return res;
                }
                if(res.returnStatus==POStatus.STATUS_NULL) {
                    continue;
                }
            }
        }
        //The nested plan processing is done or is
        //yet to begin. So process the input and start
        //nested plan processing on the input tuple
        //read
        while (true) {
           
            // we know that input has been attached
            attachInputToPlans(input);
            detachInput();
            res = processPlan();
           
            processingPlan = true;

            if(lineageTracer != null && res.result != null) {
          //we check for res.result since that can also be null in the case of flatten
          tIn = (ExampleTuple) inp.result;
          ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
          tOut.synthetic = tIn.synthetic;
          lineageTracer.insert(tOut);
          lineageTracer.union(tOut, tIn);
          res.result = tOut;
            }
View Full Code Here

                tearDown();
            }
            else
                res.returnStatus = POStatus.STATUS_OK;
            if(lineageTracer != null) {
          ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
          res.result = tOut;
            }
        } catch (IOException e) {
            log.error("Received error from loader function: " + e);
            return res;
View Full Code Here

            res.result = input;
            res.returnStatus = POStatus.STATUS_OK;
            detachInput();
            nextReturnEOP = true ;
            if(lineageTracer != null) {
          ExampleTuple tOut = (ExampleTuple) res.result;
          lineageTracer.insert(tOut);
          lineageTracer.union(tOut, tOut);
            }
            return res;
        }
View Full Code Here

        if(processingPlan){
            while(true) {
                res = processPlan();
                if(res.returnStatus==POStatus.STATUS_OK) {
                    if(lineageTracer !=  null && res.result != null) {
                  ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
                  tOut.synthetic = tIn.synthetic;
                  lineageTracer.insert(tOut);
                  lineageTracer.union(tOut, tIn);
                  res.result = tOut;
                    }
                    return res;
                }
                if(res.returnStatus==POStatus.STATUS_EOP) {
                    processingPlan = false;
                    break;
                }
                if(res.returnStatus==POStatus.STATUS_ERR) {
                    return res;
                }
                if(res.returnStatus==POStatus.STATUS_NULL) {
                    continue;
                }
            }
        }
        //The nested plan processing is done or is
        //yet to begin. So process the input and start
        //nested plan processing on the input tuple
        //read
        while (true) {
            inp = processInput();
            if (inp.returnStatus == POStatus.STATUS_EOP ||
                    inp.returnStatus == POStatus.STATUS_ERR) {
                return inp;
            }
            if (inp.returnStatus == POStatus.STATUS_NULL) {
                continue;
            }
           
            attachInputToPlans((Tuple) inp.result);
            for (PhysicalOperator po : opsToBeReset) {
                po.reset();
            }
            res = processPlan();
           
            processingPlan = true;

            if(lineageTracer != null && res.result != null) {
          //we check for res.result since that can also be null in the case of flatten
          tIn = (ExampleTuple) inp.result;
          ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
          tOut.synthetic = tIn.synthetic;
          lineageTracer.insert(tOut);
          lineageTracer.union(tOut, tIn);
          res.result = tOut;
            }
View Full Code Here

            } else
                out.append(in);
        }
       
        if(lineageTracer != null) {
            ExampleTuple tOut = new ExampleTuple();
            tOut.reference(out);
        }
        return out;
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.pen.util.ExampleTuple

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.