A Resilient Distributed Dataset (RDD), the basic abstraction in Spark.
Represents an immutable, partitioned collection of elements that can be
operated on in parallel.
|
|
__init__(self,
jrdd,
ctx,
jrdd_deserializer)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
id(self)
A unique ID for this RDD (within its SparkContext). |
source code
|
|
|
|
|
|
|
|
|
|
cache(self)
Persist this RDD with the default storage level
(MEMORY_ONLY). |
source code
|
|
|
|
persist(self,
storageLevel)
Set this RDD's storage level to persist its values across operations
after the first time it is computed. |
source code
|
|
|
|
unpersist(self)
Mark the RDD as non-persistent, and remove all blocks for it from
memory and disk. |
source code
|
|
|
|
|
|
|
isCheckpointed(self)
Return whether this RDD has been checkpointed or not |
source code
|
|
|
|
getCheckpointFile(self)
Gets the name of the file to which this RDD was checkpointed |
source code
|
|
|
|
map(self,
f,
preservesPartitioning=False)
Return a new RDD by applying a function to each element of this RDD. |
source code
|
|
|
|
flatMap(self,
f,
preservesPartitioning=False)
Return a new RDD by first applying a function to all elements of this
RDD, and then flattening the results. |
source code
|
|
|
|
mapPartitions(self,
f,
preservesPartitioning=False)
Return a new RDD by applying a function to each partition of this
RDD. |
source code
|
|
|
|
mapPartitionsWithIndex(self,
f,
preservesPartitioning=False)
Return a new RDD by applying a function to each partition of this
RDD, while tracking the index of the original partition. |
source code
|
|
|
|
|
|
|
filter(self,
f)
Return a new RDD containing only the elements that satisfy a
predicate. |
source code
|
|
|
|
|
|
|
sample(self,
withReplacement,
fraction,
seed=None)
Return a sampled subset of this RDD (relies on numpy and falls back
on default random generator if numpy is unavailable). |
source code
|
|
|
|
takeSample(self,
withReplacement,
num,
seed=None)
Return a fixed-size sampled subset of this RDD (currently requires
numpy). |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
sortByKey(self,
ascending=True,
numPartitions=None,
keyfunc=lambda x: x)
Sorts this RDD, which is assumed to consist of (key, value) pairs. |
source code
|
|
|
|
glom(self)
Return an RDD created by coalescing all elements within each
partition into a list. |
source code
|
|
|
|
cartesian(self,
other)
Return the Cartesian product of this RDD and another one, that is,
the RDD of all pairs of elements (a, b) where
a is in self and b is in
other. |
source code
|
|
|
|
|
|
|
pipe(self,
command,
env={})
Return an RDD created by piping elements to a forked external
process. |
source code
|
|
|
|
|
|
|
|
|
|
collect(self)
Return a list that contains all of the elements in this RDD. |
source code
|
|
|
|
reduce(self,
f)
Reduces the elements of this RDD using the specified commutative and
associative binary operator. |
source code
|
|
|
|
fold(self,
zeroValue,
op)
Aggregate the elements of each partition, and then the results for
all the partitions, using a given associative function and a neutral
"zero value." |
source code
|
|
|
|
aggregate(self,
zeroValue,
seqOp,
combOp)
Aggregate the elements of each partition, and then the results for
all the partitions, using a given combine functions and a neutral
"zero value." |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|