Package org.apache.pig.data

Examples of org.apache.pig.data.NonSpillableDataBag


        createJoinPlans(k);
        processingPlan = false;
        mTupleFactory = TupleFactory.getInstance();
        List<Tuple> tupList = new ArrayList<Tuple>();
        tupList.add(nullTuple);
        nullBag = new NonSpillableDataBag(tupList);
        this.isLeftOuterJoin = isLeftOuter;
        if (inputSchemas != null) {
            this.inputSchemas = inputSchemas;
        } else {
            this.inputSchemas = new Schema[replFiles == null ? 0 : replFiles.length];
View Full Code Here


                        ce.setValue(nullBag);
                    }
                    noMatch = true;
                    break;
                }
                ce.setValue(new NonSpillableDataBag(replicate.get(key).getList()));
            }

            // If this is not LeftOuter Join and there was no match we
            // skip the processing of this left tuple and move ahead
            if (!isLeftOuterJoin && noMatch)
View Full Code Here

  /**
   * @param tuples
   * @return a bag containing the provided objects
   */
  public static DataBag bag(Tuple... tuples) {
    return new NonSpillableDataBag(Arrays.asList(tuples));
  }
View Full Code Here

        if (PigMapReduce.sJobConfInternal.get() != null) {
            bagType = PigMapReduce.sJobConfInternal.get().get("pig.cachedbag.type");
        }

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

            for (int i = 0; i < numInputs - 1; i++) {
                dbs[i] = bags[i];
            }

            // For last bag, we always use NonSpillableBag.
            dbs[lastBagIndex] = new NonSpillableDataBag((int)chunkSize);

            lastBagIter = bags[lastBagIndex].iterator();

            // If we don't have any tuple for input#n
            // we do not need any further process, return EOP
View Full Code Here

            return null;
        }

        int initialSetSize = getInitialSetSize(m.values());
        Set<Object> uniqueElements = new HashSet<Object>(initialSetSize);
        DataBag bag = new NonSpillableDataBag();

        Iterator<Object> iter = m.values().iterator();

        while (iter.hasNext()) {
            Object val = iter.next();
            if (!uniqueElements.contains(val)) {
                uniqueElements.add(val);
                Tuple t = TUPLE_FACTORY.newTuple(val);
                bag.add(t);
            }
        }

        return bag;
    }
View Full Code Here

            }

            // Create a new bag if "newKey" does not exist in Map
            DataBag bag = inverseMap.get(newKey);
            if (bag == null) {
                bag = new NonSpillableDataBag();
                bag.add(TUPLE_FACTORY.newTuple(entry.getKey()));
                inverseMap.put(newKey, bag);
            } else {
                bag.add(TUPLE_FACTORY.newTuple(entry.getKey()));
            }
View Full Code Here

                return input;
            } else if (input.returnStatus == POStatus.STATUS_EOP && sendEmptyBagOnEOP)  {
                // we received an EOP from the predecessor
                // since the successor in the pipeline is
                // expecting a bag, send an empty bag
                input.result = new NonSpillableDataBag();
                input.returnStatus = POStatus.STATUS_OK;
                // we should send EOP the next time we are called
                // if the foreach in which this operator is present
                // calls this.getNext(bag) with new inputs then
                // this flag will be reset in this.reset()
View Full Code Here

        m = (Map<String, Object>)(input.get(0));
        if(m == null) {
            return null;
        }

        DataBag bag = new NonSpillableDataBag(m.size());
        for (String s : m.keySet()) {
            Tuple t = TUPLE_FACTORY.newTuple(s);
            bag.add(t);
        }

        return bag;
    }
View Full Code Here

            for(int i = 0; i < inputSchema.size(); i++) {
                t.set(i, null);
            }
            List<Tuple> bagContents = new ArrayList<Tuple>(1);
            bagContents.add(t);
            DataBag bg = new NonSpillableDataBag(bagContents);
            ce.setValue(bg);
            ce.setResultType(DataType.BAG);
            //this operator doesn't have any predecessors
            fePlan.add(ce);
           
View Full Code Here

TOP

Related Classes of org.apache.pig.data.NonSpillableDataBag

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.