org.apache.pig.data
Class DefaultDataBag
java.lang.Object
org.apache.pig.data.Datum
org.apache.pig.data.DataBag
org.apache.pig.data.DefaultDataBag
- All Implemented Interfaces:
- Comparable, Iterable<Tuple>, Spillable
public class DefaultDataBag
- extends DataBag
An unordered collection of Tuples (possibly) with multiples. The tuples
are stored in an ArrayList, since there is no concern for order or
distinctness.
Method Summary |
boolean |
isDistinct()
Find out if the bag is distinct. |
boolean |
isSorted()
Find out if the bag is sorted. |
Iterator<Tuple> |
iterator()
Get an iterator to the bag. |
long |
spill()
Instructs an object to spill whatever it can to disk and release
references to any data structures it spills. |
Methods inherited from class org.apache.pig.data.DataBag |
add, addAll, cardinality, clear, compareTo, content, equals, finalize, getMemorySize, getSpillFile, hashCode, markStale, reportProgress, size, toString, write |
DefaultDataBag
public DefaultDataBag()
isSorted
public boolean isSorted()
- Description copied from class:
DataBag
- Find out if the bag is sorted.
- Specified by:
isSorted
in class DataBag
isDistinct
public boolean isDistinct()
- Description copied from class:
DataBag
- Find out if the bag is distinct.
- Specified by:
isDistinct
in class DataBag
iterator
public Iterator<Tuple> iterator()
- Description copied from class:
DataBag
- Get an iterator to the bag. For default and distinct bags,
no particular order is guaranteed. For sorted bags the order
is guaranteed to be sorted according
to the provided comparator.
- Specified by:
iterator
in interface Iterable<Tuple>
- Specified by:
iterator
in class DataBag
spill
public long spill()
- Description copied from interface:
Spillable
- Instructs an object to spill whatever it can to disk and release
references to any data structures it spills.
Copyright © ${year} The Apache Software Foundation