Examples of InternalCachedBag


Examples of org.apache.pig.data.InternalCachedBag

                // case we don't want to pay the penalty all the time.

                // Additionally, if there is a merge join(on a different key) following POCollectedGroup
                // default bags should be used. But since we don't allow anything
                // before Merge Join currently we are good.
                        : new InternalCachedBag(1);
                outputBag.add((Tuple)tup.get(1));
                continue;
            }

            // no key change
            if (prevKey == null && curKey == null) {
                outputBag.add((Tuple)tup.get(1));
                continue;
            }

            // no key change
            if (prevKey != null && curKey != null && ((Comparable)curKey).compareTo(prevKey) == 0) {
                outputBag.add((Tuple)tup.get(1));
                continue;
            }

            // key change
            Tuple tup2 = mTupleFactory.newTuple(2);
            tup2.set(0, prevKey);
            tup2.set(1, outputBag);
            res.result = tup2;

            prevKey = curKey;
            outputBag = useDefaultBag ? BagFactory.getInstance().newDefaultBag()
                    : new InternalCachedBag(1);
            outputBag.add((Tuple)tup.get(1));
            return res;
        }

        return inp;
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                            // POPackage in the pipeline and is also blocking the
                            // pipeline;
                            // constructor argument should be 2 * numInputs. But for one
                            // obscure
                            // case we don't want to pay the penalty all the time.
                            : new InternalCachedBag(numInputs);
                }
                // For each indexed tup in the inp, sort them
                // into their corresponding bags based
                // on the index
                while (tupIter.hasNext()) {
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                if (bagType != null && bagType.equalsIgnoreCase("default")) {
                    useDefaultBag = true;
                }
            }
        }
        return useDefaultBag ? new NonSpillableDataBag() : new InternalCachedBag(numBags);
    }
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                            cur = readers.get(i).getCurrentKey();
                            // We need to loop in case of Grouping Comparators
                            while (comparator.compare(min, cur) == 0
                                    && (!min.isNull() || (min.isNull() && i == minIndex))) {
                                Iterable<Object> vals = readers.get(i).getCurrentValues();
                                bag = bags[i] == null ? new InternalCachedBag(numInputs) : bags[i];
                                for (Object val : vals) {
                                    NullableTuple nTup = (NullableTuple) val;
                                    int index = nTup.getIndex();
                                    Tuple tup = pkgr.getValueTuple(keyWritable, nTup, index);
                                    bag.add(tup);
                                }
                                bags[i] = bag;
                                finished[i] = !readers.get(i).next();
                                if (finished[i]) {
                                    break;
                                }
                                cur = readers.get(i).getCurrentKey();
                            }
                        }

                        if (bag == null) {
                            bags[i] = new InternalCachedBag(numInputs);
                        }
                    }
                }

                pkgr.attachInput(key, bags, readOnce);
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

         }
                                              
      if (bagType != null && bagType.equalsIgnoreCase("default")) {
        return new NonSpillableDataBag();
      }
      return new InternalCachedBag(numBags);   
    }
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                dbs[i] = useDefaultBag ? BagFactory.getInstance().newDefaultBag()
                // In a very rare case if there is a POStream after this
                // POJoinPackage in the pipeline and is also blocking the pipeline;
                // constructor argument should be 2 * numInputs. But for one obscure
                // case we don't want to pay the penalty all the time.       
                        : new InternalCachedBag(numInputs-1);                   
            }
            // For last bag, we always use NonSpillableBag.
            dbs[lastBagIndex] = new NonSpillableDataBag((int)chunkSize);
           
            //For each Nullable tuple in the input, put it
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                    dbs[i] = useDefaultBag ? BagFactory.getInstance().newDefaultBag()
                    // In a very rare case if there is a POStream after this
                    // POPackage in the pipeline and is also blocking the pipeline;
                    // constructor argument should be 2 * numInputs. But for one obscure
                    // case we don't want to pay the penalty all the time.
                            : new InternalCachedBag(numInputs);
                }
                //For each indexed tup in the inp, sort them
                //into their corresponding bags based
                //on the index
                while (tupIter.hasNext()) {
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                // case we don't want to pay the penalty all the time.

                // Additionally, if there is a merge join(on a different key) following POCollectedGroup
                // default bags should be used. But since we don't allow anything
                // before Merge Join currently we are good.
                        : new InternalCachedBag(1);
                outputBag.add((Tuple)tup.get(1));
                continue;
            }

            // no key change
            if (prevKey == null && curKey == null) {
                outputBag.add((Tuple)tup.get(1));
                continue;
            }

            // no key change
            if (prevKey != null && curKey != null && ((Comparable)curKey).compareTo(prevKey) == 0) {
                outputBag.add((Tuple)tup.get(1));
                continue;
            }

            // key change
            Tuple tup2 = mTupleFactory.newTuple(2);
            tup2.set(0, prevKey);
            tup2.set(1, outputBag);
            res.result = tup2;

            prevKey = curKey;
            outputBag = useDefaultBag ? BagFactory.getInstance().newDefaultBag()
                    : new InternalCachedBag(1);
            outputBag.add((Tuple)tup.get(1));
            return res;
        }

        return inp;
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                dbs[i] = useDefaultBag ? BagFactory.getInstance().newDefaultBag()
                // In a very rare case if there is a POStream after this
                // POJoinPackage in the pipeline and is also blocking the pipeline;
                // constructor argument should be 2 * numInputs. But for one obscure
                // case we don't want to pay the penalty all the time.       
                        : new InternalCachedBag(numInputs-1);                   
            }
            // For last bag, we always use NonSpillableBag.
            dbs[lastBagIndex] = new NonSpillableDataBag((int)chunkSize);
           
            //For each Nullable tuple in the input, put it
View Full Code Here

Examples of org.apache.pig.data.InternalCachedBag

                    dbs[i] = useDefaultBag ? BagFactory.getInstance().newDefaultBag()
                    // In a very rare case if there is a POStream after this
                    // POPackage in the pipeline and is also blocking the pipeline;
                    // constructor argument should be 2 * numInputs. But for one obscure
                    // case we don't want to pay the penalty all the time.               
                            : new InternalCachedBag(numInputs);                   
                }                              
                //For each indexed tup in the inp, sort them
                //into their corresponding bags based
                //on the index
                while (tupIter.hasNext()) {
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.