Examples of ExampleTuple


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

                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

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

            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);
            Tuple tuple = (Tuple)inp.result;
           
            for (PhysicalOperator po : opsToBeReset) {
                po.reset();
            }
           
            if (isAccumulative()) {             
                for(int i=0; i<tuple.size(); i++) {               
                    if (tuple.getType(i) == DataType.BAG) {
                        // we only need to check one bag, because all the bags
                        // share the same buffer
                        buffer = ((AccumulativeBag)tuple.get(i)).getTuplebuffer();
                        break;
                    }
                }
               
                while(true) {                       
                    if (buffer.hasNextBatch()) {       
                        try {
                            buffer.nextBatch();
                        }catch(IOException e) {
                            throw new ExecException(e);
                        }
                       
                        setAccumStart();                   
                    }else{               
                        buffer.clear();
                        setAccumEnd();                   
                    }
                   
                    res = processPlan();             
                   
                    if (res.returnStatus == POStatus.STATUS_BATCH_OK) {
                        // attach same input again to process next batch
                        attachInputToPlans((Tuple) inp.result);
                    } else {
                        break;
                    }
                }
               
            } else {                       
                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

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

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

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

            }

        }
       
        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

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

 
  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

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

        && 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

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

                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

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

        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) input;
          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

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

            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;
                    for(PhysicalPlan plan : inputPlans)
                        plan.detachInput();
                    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);
            Tuple tuple = (Tuple)inp.result;
           
            for (PhysicalOperator po : opsToBeReset) {
                po.reset();
            }
           
            if (isAccumulative()) {             
                for(int i=0; i<tuple.size(); i++) {               
                    if (tuple.getType(i) == DataType.BAG) {
                        // we only need to check one bag, because all the bags
                        // share the same buffer
                        buffer = ((AccumulativeBag)tuple.get(i)).getTuplebuffer();
                        break;
                    }
                }
                setAccumStart();                               
                while(true) {                       
                    if (buffer.hasNextBatch()) {       
                        try {
                            buffer.nextBatch();
                        }catch(IOException e) {
                            throw new ExecException(e);
                        }

                    }else{               
                        buffer.clear();
                        setAccumEnd();                   
                    }
                   
                    res = processPlan();             
                   
                    if (res.returnStatus == POStatus.STATUS_BATCH_OK) {
                        // attach same input again to process next batch
                        attachInputToPlans((Tuple) inp.result);
                    } else {
                        break;
                    }
                }
               
            } else {                       
                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

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

            } else
                out.append(in);
        }
       
        if(lineageTracer != null) {
            ExampleTuple tOut = new ExampleTuple();
            tOut.reference(out);
        }
        return out;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.