Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/2216#discussion_r16946191
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala ---
@@ -603,14 +603,14 @@ abstract class DStream[T: ClassTag] (
* Print the first ten elements of each RDD generated in this DStream.
This is an output
* operator, so this DStream will be registered as an output stream and
there materialized.
*/
- def print() {
+ def print(num: Int = 10) {
def foreachFunc = (rdd: RDD[T], time: Time) => {
- val first11 = rdd.take(11)
+ val firstNum = rdd.take(num + 1)
--- End diff --
It matches the original logic, which takes 11 in order to print 10. If
there are 11 elements, it prints "..." at the end to indicate there is at least
one more that is not printed.
---
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]