Github user koeninger commented on a diff in the pull request:
https://github.com/apache/spark/pull/6632#discussion_r32872490
--- Diff:
external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaRDDSuite.scala
---
@@ -68,6 +68,21 @@ class KafkaRDDSuite extends SparkFunSuite with
BeforeAndAfterAll {
val received = rdd.map(_._2).collect.toSet
assert(received === messages)
+
+ // size-related method optimizations return sane results
+ assert(rdd.count === messages.size)
+ assert(rdd.countApprox(0).getFinalValue.mean === messages.size)
+ assert(! rdd.isEmpty)
+ assert(rdd.take(1).size === 1)
+ assert(messages(rdd.take(1).head._2))
--- End diff --
It's asserting that item taken from the rdd is a member of the set of
messages sent
On Fri, Jun 19, 2015 at 4:07 PM, Tathagata Das <[email protected]>
wrote:
> In
>
external/kafka/src/test/scala/org/apache/spark/streaming/kafka/KafkaRDDSuite.scala
> <https://github.com/apache/spark/pull/6632#discussion_r32869380>:
>
> > @@ -68,6 +68,21 @@ class KafkaRDDSuite extends SparkFunSuite with
BeforeAndAfterAll {
> >
> > val received = rdd.map(_._2).collect.toSet
> > assert(received === messages)
> > +
> > + // size-related method optimizations return sane results
> > + assert(rdd.count === messages.size)
> > + assert(rdd.countApprox(0).getFinalValue.mean === messages.size)
> > + assert(! rdd.isEmpty)
> > + assert(rdd.take(1).size === 1)
> > + assert(messages(rdd.take(1).head._2))
>
> What does this check? Shouldnt it check that rdd.take(1) === "the" //
> whatever is expected
>
> â
> Reply to this email directly or view it on GitHub
> <https://github.com/apache/spark/pull/6632/files#r32869380>.
>
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]